Method and apparatus in a data processing system for systematically separating application graphical user interface component placement from component sequencing and compound creation

ABSTRACT

A method and apparatus in a data processing system for displaying a component or container. The container is displayed within a display using a first component. A location of the component or container is controlled within the display using a second component, wherein the second component controls the location and geometry of the component or container in response to receiving an event. The component or container is selectively displayed using a third component, wherein the third component generates the event.

This application is a DIV of U.S. Ser. No. 09/366,404, filed Aug. 3,1999.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates generally to an improved distributed dataprocessing system and, in particular to an improved method and apparatusfor creating applications. Still more particularly, the presentinvention relates to a method and apparatus for creating clientapplications.

2. Description of Related Art

Distributed data processing systems involve data transfers betweenclients and servers (also know as services). Typically, a client locatesa server, initiates a session with a server and requests the server toperform some service. The server expects requests from a client toarrive in a particular format. A server is more complex than a clientbecause the server typically handles a large number of clientssimultaneously, often fetches and stores information from a largedatabase, creates additional transactions for other services, performsbusiness logic, and returns information formatted according to eachclient channel.

For example, data will be specified in a particular message format. Aparticular transmission protocol will deliver the message to the server.The server accepts the message protocol as its application programmingmodel (API) to its services and returns a result. A variety of softwaresystems, such as Enterprise Java Beans (EJB), Servlets, Java ServerPages (JSP), and XML have been implemented to enhance the development ofclient and server-side software.

Client applications perform a number of different functions. Forexample, the application on the client side handles the user interfaceand may provide program logic for processing user input. Additionally, aclient application must match the requirements of a particular server toprovide communications with the particular server. Clients are packagedand distributed according to the services provided by the server.

A graphical user interface (GUI) exists in the client application tohandle what the user views on the screen. Events resulting from userinput, such as mouse clicks or keyboard strokes, are detected andhandled using “listener” processes in the application. The events areprocessed by program logic. The program logic may result in requestsbeing sent to a server. Communication with the server is provided usingprocesses that use protocols, such as hypertext transfer protocol(HTTP), secure sockets (SSL), or Remote Method Invocation (RMI).

Client software can be either “thick” or “thin”. A thick client istypically a large client-installed application that may access adatabase directly and apply business logic. They typically havedependence on the client operating system and require manual support toinstall and configure. By contrast a thin client is typically a smallapplication downloaded on request from a server and accesses thedatabase through an intermediate application server. This is known as amulti-tier application. A number of different usage scenarios forclients are present, resulting in a variety of client needs beingpresent. For example, it is typical that in an global enterpriseIntranet, the client configuration is controlled by the business but thelarge number of clients includes older machines with slow networks (e.g.9600 baud). Likewise, in the Internet, there is little configurationcontrol by the business and it is estimated that a large percentage ofclients worldwide still use 14.4 K connections that result in very slownetwork speeds and downloads. A typical user will become very frustratedif downloads take longer than a minute or two. Further, mobile usersrequire compact software that can be customized and packaged to fit onmachines and operate disconnected from the network. Subsequent automatedsupport to connect to the network is needed.

At the other end of the spectrum, power users with high speedconnections expect screen refresh times in the sub-second range and“instantaneous” echoing of typed characters to provide the look and feelof processing in a local environment. In a multi-tier computingenvironment, the primary role of the client is to present and gatherinformation quickly. The client application is considered a businessasset independent of the network topology and server function. In theseenvironments, it is desirable to be able to use the same clientprocessing code for different user types and interface channels, such asautomated teller machines (ATM), Kiosks, Internet [hypertext markuplanguage (HTML)/applets], and regional office clients (applications).

Consequently, a common thin or thick client development environment fordeveloping clients may be used to solve these problems, especially whenthe size and speed of the application download, integration andoperation is important. Any software development environment should bebased on sound software engineering principles.

Object-oriented languages have been employed in creating thin clients.Object-oriented programming environments have been presented asproviding software reuse, which is a desirable feature in creating thinclients and reducing development time. In reality, the presentobject-oriented programming environments for developing thin clients areunable to provide enough object reuse and repeatability for quicklydeveloping thin clients. Nor do they specify how to readily supportadditional message formats, protocols, data models and servers, mobiledisconnected users, and caching.

Therefore, it would be advantageous to have an improved method andapparatus for a client development architecture that facilitatescreating thin clients in a manner in which component reuse is increasedwhile client development time is reduced, and multiple message formats,protocols, data models and servers, mobile disconnected users andcaching can be readily integrated.

SUMMARY OF THE INVENTION

The present invention provides an architectural pattern for creatingapplications for a data processing system. A graphical user interface iscreated in which the graphical user interface includes a plurality ofcomponents. Processes for presenting the plurality of components andreceiving user input are handled by a first set of graphical objects,wherein in response to selected user input, a first event is generated.An application object is created in which the application processcontrols an order in which the graphical objects present the set ofcomponents and process the event and wherein the application generates asecond event. A transport object is created in which the transportobject processes the second event and forwards the second event forprocessing to a destination within the plurality of destinations. Aplurality of destination objects are created in which each destinationobject within the plurality of destinations objects handles accessing adestination within the plurality of destinations.

The present invention provides a method and apparatus in a dataprocessing system for refreshing data in an application. A call isreceived to update data in the application, wherein the data is destinedfor a component in the application. A data type is identified for thedata. Responsive to the data type being a handled data type, the data isformatted and a refresh is called on the component.

The present invention provides a method and apparatus in a dataprocessing system for displaying a component or container. The containeris displayed within a display using a first component. A location of thecomponent or container is controlled within the display using a secondcomponent, wherein the second component controls the location andgeometry of the component or container in response to receiving anevent. The component or container is selectively displayed using a thirdcomponent, wherein the third component generates the event.

The present invention provides a process in a data processing system formanaging services in a desktop environment from an objectoriented-environment. A presentation of a graphical user interface iscontrolled using a view controller, wherein the view controller handlesuser input to the graphical user interface. Responsive to a selecteduser input, the selected user input is sent from the view controller toan application mediator. Responsive to receiving the selected user inputat the application mediator, the selected user input is processed at theapplication mediator. Responsive to the application mediator determiningthat a service is required in the desktop environment, an event isgenerated. Responsive to detecting the event at a listener object, amethod is executed in the listener object to perform the service in thedesktop environment.

The present invention provides a method and apparatus in a dataprocessing system for managing transactions. A request event is receivedat a transporter object. The request event includes a target and anindication of how to handle the request event. A destination object isidentified within the plurality of destination objects using the requestevent to form an identified destination object. The request event issent to the identified destination object, wherein the identifieddestination object handles the request using the indication and accessesthe target.

The present invention provides a method and apparatus in a dataprocessing system for displaying a graphical user interface. A containeris displayed in a graphical user interface from a set of containers,wherein a display of the container handled by a view controller from aset of view controllers. Each view controller handles the display of anassociated container within the set of containers and user input for theassociated container. A display of the set of containers is altered byan application mediator, wherein the set of containers are displayed inan order determined by the application mediator.

The present invention provides a method and apparatus in a dataprocessing system for performing validation of user input. User input isreceived in a container displayed in a graphical user interface, whereinpresentation of the container and the user input to the container arehandled by a view controller. Responsive to receiving the user input, acall is sent to a validation object by the view controller. Responsiveto the call, the validation object tests the user input using acriteria, wherein the rule is separate from the view controller.

The present invention provides a method and apparatus in a dataprocessing system for managing permissions in an application. A userinput is received at a container handled by a view controller, whereinthe user input requests a change in permissions in the application. Thisuser input, may be, for example, a change in security in an applicationthrough a login process. A view event describing the user input isgenerated. The view event is received at an application mediator.Responsive to receiving the view event, by the application mediator, arequest event is generated and a permission corresponding to the userinput is received. The permission alters an item, which may be in eitherof both the view controller and the application mediator.

The present invention provides a process and apparatus in a dataprocessing system for presenting a view to a client. At an applicationmediator, a view event is received from a view controller, wherein theview event describes an action on a displayed container handled by theview controller. Responsive to a requirement that a change in aplacement of the displayed container is required, a placement event isgenerated by the application mediator. A determination is then made by aplacement listener, as to whether the placement event includes anindication that an alternate view is to be generated. Responsive to adetermination that an alternate view is to be generated, a call is sentto a method in the view controller to generate the alternate view.

The present invention provides a method and apparatus in a dataprocessing system for processing user input in a graphical userinterface. A graphical user interface is presented using a viewcontroller, wherein the view controller handles the user input to thegraphical user interface. Responsive to a selected user input, an eventis sent to a first application mediator. Responsive to the firstapplication mediator being unable to process the event, the event issent to a second application mediator for processing, wherein the firstapplication mediator and the second application mediator handle an orderin which a set of displays are displayed by a view controller.

The present invention provides a method and apparatus in a dataprocessing system for presenting a set of screens in a graphical userinterface. A first screen within a set of screens is presented, whereinthe set of screens are presented using a set of view controllers.Responsive to a selected user input to the first screen, an event isgenerated by a view controller within the set of view controllersidentifying the user input to the first screen, which is handled by thefirst view controller. Responsive to detecting the event generated bythe view controller, a second screen from the set of screens isselected, by an application mediator, for display by sending a responseto a view controller handling the second screen.

The application mediator is initialized from reading a state machinefile and control processing of view event received from virtualcontrollers.

The present invention provides a method and apparatus in a dataprocessing system for serializing data. A serializer receives a dataelement for serialization, wherein the data element includes a classname string. Responsive to receiving the data element, the serializerreplaces the class name string with a code having a smaller size thanthe class name string to form a modified data element. Responsive toforming the modified data element, in which the serializer serializesthe modified data element. This serialized data is transmitted anddeserialized by a deserializer, which replaces the indicator with theclass name.

The present invention provides a method and apparatus in a dataprocessing system for providing an interface to an application formonitoring execution of the application. An event generated by a viewcontroller is detected, wherein the view controller handles presentationof a container in a graphical user interface. A determination is made asto whether the event is an event selected for monitoring. Responsive tothe determination that the event is an event selected for monitoring, arequest event is generated, wherein the request event includes data fromthe event and a destination.

The present invention provides a method and apparatus for a dataprocessing system for accessing classes and methods in an objectoriented system. Responsive to receiving a selected user input to acontainer, a view event is sent from a view controller to an applicationmediator. The view event identifies an action taken to generate theselected user input. A request is selectively generated based on theview event, wherein the request event includes a major code identifyinga class name as a destination and a minor code identifying a method namea function to be invoked. The request event is sent to a transporter.The transporter acts as a router to send the request event to anappropriate destination object from a plurality of destination objects.Responsive to receiving the request event at the transporter, therequest event is sent to a destination object within a plurality ofdestination objects based in the class name. The destination objectformats the request event into a form recognizable by the destinationassociated with the destination object. The destination may be locatedon a remote data processing system. The request event is used to accessthe class or method identified in the request event. The access may be,for example, an invocation of the method.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself, however, as well asa preferred mode of use, further objectives and advantages thereof, willbest be understood by reference to the following detailed description ofan illustrative embodiment when read in conjunction with theaccompanying drawings, wherein:

FIG. 1 depicts a pictorial representation of a distributed dataprocessing system in which the present invention may be implemented;

FIG. 2 is a block diagram depicting a data processing system that may beimplemented as a server in accordance with a preferred embodiment of thepresent invention;

FIG. 3 is a block diagram illustrating a data processing system in whichthe present invention may be implemented;

FIG. 4 is a diagram illustrating a model view controller diagramdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 5 is a diagram illustrating the components in an architecturalpattern depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 6 is a diagram illustrating classes in a class hierarchy depictedin accordance with a preferred embodiment of the present invention;

FIG. 7 is a unified modeling language diagram depicted in accordancewith a preferred embodiment of the present invention;

FIGS. 8A and 8B are diagrams illustrating variables and methods in aViewController depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 9A-9E are diagrams illustrating variables, constructors, andmethods for ViewControllerImpl depicted in accordance with a preferredembodiment of the present invention;

FIGS. 10A-10C are tables which show the variables, constructors andmethods for ViewControllerBaseImpl depicted in accordance with apreferred embodiment of the present invention;

FIGS. 11A-11C are tables which illustrate a variable, a constructor, andmethods for a ViewControllerAdapter depicted in accordance with apreferred embodiment of the present invention;

FIGS. 12A-12D are drawings illustrating variables, constructors, andmethods for a ValidationRule depicted in accordance with a preferredembodiment of the present invention;

FIGS. 13A and 13B are tables illustrating variables and constructors fora ValidationRuleException depicted in accordance with a preferredembodiment of the present invention;

FIGS. 14A-14F are diagrams illustrating variables, constructors, andmethods for a ViewEvent depicted in accordance with a preferredembodiment of the present invention;

FIGS. 15A and 15B are diagrams illustrating a variable and a method fora ViewListener depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 16A and 16B diagrams illustrating a variable and methods for anApplicationMediator depicted in accordance with a preferred embodimentof the present invention;

FIGS. 17A-17E are diagrams illustrating variables and a conductor for anApplicationMediatorImpl depicted in accordance with a preferredembodiment of the present invention;

FIGS. 17F-17I are diagrams illustrating code used in methods for anApplicationMediatorImpl depicted in accordance with a preferredembodiment of the present invention;

FIGS. 17J-17M are diagrams which depicts code used to handle the eventdispatch in accordance with a preferred embodiment of the presentinvention;

FIGS. 18A-18C are diagrams illustrating variables, constructors, andmethods for a PlacementEvent depicted in accordance with a preferredembodiment of the present invention;

FIGS. 19A and 19B are diagrams illustrating a variable and method for aPlacementListener depicted in accordance with a preferred embodiment ofthe present invention;

FIGS. 20A-20C are diagrams illustrating variables, constructors, andmethods for a TopEvent depicted in accordance with a preferredembodiment of the present invention;

FIGS. 21A and 21B are diagrams illustrating a variable and methods forTopListeners depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 22A-22C are diagrams illustrating a variable, constructors, andmethods for RequestEvent depicted in accordance with a preferredembodiment of the present invention;

FIG. 23A-23C are diagrams illustrating a variable, constructors, andmethods for a RequestException depicted in accordance with a preferredembodiment of the present invention;

FIGS. 24A and 24B are diagrams illustrating a variable and methods for aRequestListener depicted in accordance with a preferred embodiment ofthe present invention;

FIGS. 25A and 25B are diagrams illustrating a variable and methods for aRequestResponseListener depicted in accordance with a preferredembodiment of the present invention;

FIGS. 26A-26C are diagrams illustrating variables, a constructor, andmethods for a Transporter depicted in accordance with a preferredembodiment of the present invention;

FIGS. 26D-26H are diagrams illustrating code used in methods in aTransporter depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 27A and 27B are diagrams illustrating a variable and methods for aDestination depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 26A-26C are diagrams illustrating variables, constructors, andmethods for a DestinationImpl depicted in accordance with a preferredembodiment of the present invention;

FIG. 28D is code used to process a RequestEvent depicted in accordancewith a preferred embodiment of the present invention;

FIGS. 29A and 29B are diagrams illustrating variables and methods in aFactory depicted in accordance with a preferred embodiment of thepresent invention;

FIGS. 30A and 30B are diagrams illustrating a variable and methods forJTC depicted in accordance with a preferred embodiment of the presentinvention;

FIG. 31 is a flowchart of a process for creating a ViewControllerdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 32 is a flowchart of a process for creating ValidationRulesdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 33 is a flowchart of a process for creating a ViewEvent depicted inaccordance with a preferred embodiment of the present invention;

FIG. 34 is a flowchart of a process to create an ApplicationMediatordepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 35 is a flowchart of a process for creating a RequestEvent depictedin accordance with a preferred embodiment of the present invention;

FIG. 36 is a flowchart of a process for creating a Destination depictedin accordance with a preferred embodiment of the present invention;

FIG. 37 is a flowchart of a process for creating a TopListener depictedin accordance with a preferred embodiment of the present invention;

FIG. 38 is a flowchart of a process for creating a PlacementListenerdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 39 is a diagram illustrating runtime behavior of a ViewControllersubsystem depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 40 are steps in the operation of a ViewController subsystem, asviewed from a ViewControllerImpl, depicted in accordance with apreferred embodiment of the present invention;

FIG. 41 is a flowchart of a process for a JTC application to presentalternate views (HTML/XML) of itself while running in a separateenvironment, such as a server, as the alternate views depicted inaccordance with a preferred embodiment of the present invention;

FIGS. 42 and 43 are diagrams detailing processes within theViewController subsystem depicted in accordance with a preferredembodiment of the present invention;

FIG. 44 is a complete list of predefined major event codes depicted inaccordance with a preferred embodiment of the present invention;

FIG. 45 shows how a text field representing a social security number canbe validated and displayed depicted in accordance with a preferredembodiment of the present invention;

FIG. 46 shows how a social security number can be validated andconverted back to a transmittable format depicted in accordance with apreferred embodiment of the present invention;

FIG. 47 illustrates the application of two edit rules, range checking,and formatting for viewing depicted in accordance with a preferredembodiment of the present invention;

FIG. 48 illustrates inheritance where the ViewControllerBaseImpl is asubclass of JPanel from the Java swing components depicted in accordanceof a preferred embodiment of the present invention;

FIG. 49 illustrates inheritance where the ViewControllerBaseImpl is asubclass of java.lang.Object and where the methods getComponent,setEnabled and setVisible are implement ed to ensure the ViewControllersubclassing ViewControllerBaseImpl can be treated as a GUI component,container or bean depicted in accordance of a preferred embodiment ofthe present invention;

FIG. 50 is a diagram illustrating runtime behavior of anApplicationMediator subsystem depicted in accordance with a preferredembodiment of the present invention;

FIG. 51 is a diagram illustrating Event threading support depicted inaccordance with a preferred embodiment of the present invention;

FIG. 52 is a flowchart of a process used in designing and executing anApplicationMediator depicted in accordance with a preferred embodimentof the present invention;

FIG. 53 is a diagram illustrating runtime behavior of the Placementsubsystem is depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 54 is Java code illustrating the creation and firing of aPlacementEvent in an ApplicationMediator depicted in accordance with apreferred embodiment of the present invention;

FIG. 55 is Java code illustrating the callback to a PlacementListenerwith a PlacementEvent and inspecting the PlacementEvent for semanticinterpretation depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 56 is a flowchart of a process used in processing a PlacementEventdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 57 is a diagram illustrating runtime behavior for a TopListenersubsystem depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 58 is Java code illustrating the creation of an ApplicationMediatorand the adding of a PlacementListener depicted in accordance with apreferred embodiment of the present invention;

FIG. 59, is Java code illustrating the creation and firing of a TopEventin an ApplicationMediator depicted in accordance with a preferredembodiment of the present invention;

FIG. 60 is Java code illustrating the callback to a TopListener with aTopEvent and inspecting the TopEvent for semantic interpretationdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 61 is a diagram illustrating runtime behavior of a RequestEventsubsystem depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 62 is Java code illustrating the creation of RequestEvent, settingits major and minor codes, and firing an asynchronous RequestEvent froman ApplicationMediator depicted in accordance with a preferredembodiment of the present invention;

FIG. 63 is Java code illustrating the callback, to anApplicationMediator, a successful asynchronous RequestEvent with aresult depicted in accordance with a preferred embodiment of the presentinvention;

FIG. 64 is Java code illustrating the callback, to anApplicationMediator, an unsuccessful asynchronous RequestEvent with aRequestException depicted in accordance with a preferred embodiment ofthe present invention;

FIG. 65 is a flowchart of a process for using a RequestEvent depicted inaccordance with a preferred embodiment of the present invention;

FIG. 66 is a diagram illustrating runtime behavior of a Transportersubsystem depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 67 is Java code illustrating creation of a Transporter and addingit as a RequestListener depicted in accordance with a preferredembodiment of the present invention;

FIG. 68 is runtime behavior of a Destination subsystem shown inaccordance with a preferred embodiment of the present invention;

FIG. 69 is a diagram of Java code for creation of a Destination, settinga major code and adding it to a Transporter as a DestinationListenerdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 70 is a diagram illustrating Java code for creating Destinationwith wild card, priority and normal major codes, firing a RequestEvent,and a report of the expected results depicted in accordance with apreferred embodiment of the present invention;

FIG. 71 is a diagram of Java code used for accessing, identifying typeand recursively attaching JTC, AWT and JFC listeners to JTC, AWT and JFCprograms and objects depicted in accordance with a preferred embodimentof the present invention;

FIG. 72 is a diagram of Java code used for attaching JTC listeners toJTC ApplicationMediators, ViewControllers and Transporters depicted inaccordance with a preferred embodiment of the present invention;

FIG. 73 is a diagram of Java code used for attaching AWT and JFClisteners for AWT and JFC containers, components and beans depicted inaccordance with a preferred embodiment of the present invention;

FIG. 74 is a diagram of Java code used for attaching AWT and JFClisteners to AWT and JFC components (java.awt.Button,com.sun.swing.java.JButton and com. and com.sun.java.swing.JTextField)depicted in accordance with a preferred embodiment of the presentinvention;

FIG. 75 is a flowchart of a process for for performing hookJTCs andhookAWTs, non intrusive tracing, hooking, debugging, monitoring andlogging of JTC programs and JTC program objects depicted in accordancewith a preferred embodiment of the present invention;

FIG. 76 is a program describing the relationship between components andcontainers depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 77 is a flowchart of a process for performing hookAWTs depicted inaccordance with the preferred embodiment of the present invention;

FIG. 78 is a process for hooking an AWT and JFC component depicted inaccordance with the preferred embodiment of the present invention;

FIGS. 79-82 are diagrams of Java code for use in managing the refresh ofdata objects in an ApplicationMediator (79), managing the refresh ofdata objects in a ViewController using initial types (80), and managingthe refresh of data objects in a ViewController using an multipleconcurrent updated or additional data types (81, 82) depicted inaccordance with a preferred embodiment of the present invention;

FIG. 83 is a diagram of using multiple concurrent data model updatenotification mechanisms in a ViewController and ApplicationMediatordepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 84 is a flowchart of a process used in a TopListener depicted inaccordance with a preferred embodiment of the present invention;

FIG. 85 is a flowchart of a PlacementListener depicted in accordancewith a preferred embodiment of the present invention;

FIG. 86 is a flowchart illustrating handling of AWTEvents by aViewController depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 87 is a flowchart illustrating application of ValidationRulesdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 88 is a flowchart of a process for firing a ViewEvent depicted inaccordance with a preferred embodiment of the present invention;

FIGS. 89-95 are flowcharts illustrating processes used by anApplicationMediator depicted in accordance with a preferred embodimentof the present invention;

FIGS. 96 and 97 are diagrams illustrating processes used to refreshobject data in an ApplicationMediator and ViewController depicted inaccordance with a preferred embodiment of the present invention;

FIG. 98 is a flowchart of a process used to process RequestEventsdepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 99 is a flowchart of an initialization process for creatinghierarchical ApplicationMediators depicted in accordance with apreferred embodiment of the present invention;

FIG. 100 is a flowchart of a process for handling events in ahierarchical ApplicationMediator system depicted in accordance with apreferred embodiment of the present invention;

FIG. 101 is a flowchart for a process for building a virtualApplicationMediator state dispatching machine depicted in accordancewith a preferred embodiment of the present invention;

FIG. 102 illustrates example table entries from the loading of aconfiguration file for a virtual ApplicationMediator state machinedepicted in accordance of a preferred embodiment of the presentinvention;

FIGS. 103 and 104 are virtual ApplicationMediator access statedispatching machine used to determine whether processing of a ViewEventis needed depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 105 is a diagram of a serializer system write depicted inaccordance with a preferred embodiment of the present invention;

FIG. 106 is a diagram of a serializer system read depicted in accordancewith a preferred embodiment of the present invention;

FIGS. 107A-107C are diagrams illustrating an object array depicted inaccordance with a preferred embodiment of the present invention;

FIGS. 108A-108B are diagrams illustrating code used in a serializationmethod depicted in accordance with a preferred embodiment of the presentinvention;

FIG. 109 implements the methods readExternal and writeExternal forreading/writing from/to input/output stream depicted in accordance of apreferred embodiment of the present invention;

FIGS. 110A-110D are diagrams illustrating code used in a serializationmethod depicted in accordance with a preferred embodiment of the presentinvention;

FIG. 111 is a flowchart of a process for using a serializer depicted inaccordance with the preferred embodiment of the present invention;

FIG. 112 is a flowchart of a process for statically creating matchinguser profiles and associated JTC permission keys for JTC programs, wherekeys are built by recursively querying JTC ApplicationMediator andViewController objects, depicted in accordance with a preferredembodiment of the present invention;

FIG. 113 is a flowchart of a process for a JTC program building adatabase of permission keys by iterating over JTC ApplicationMediator'sgetPermissions method and returning permission keys that areViewController names that are alterable at runtime depicted inaccordance with a preferred embodiment of the present invention;

FIG. 114 is a flowchart of a process for a JTC ApplicationMediatorbuilding a database of permission keys by iterating over JTCViewController's getPermissions method and returning permission keysthat are names known only to the ViewController and hat are alterable atruntime depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 115 is a flowchart of a process for a JTC ViewController building adatabase of permission keys by iterating over runtime alterablecomponents, containers and beans and returning permission keys that arecomponent, container or bean names that are alterable at runtimedepicted in accordance with a preferred embodiment of the presentinvention;

FIG. 116 is a flowchart of a process for a JTC program accepting adatabase of permission keys by retrieving permission key/value datasupplying the data to a JTC program depicted in accordance with apreferred embodiment of the present invention;

FIG. 117 is a flowchart of a process for a JTC program supplied with asetting of permission key/value data and iterating over allApplicationMediators and passing the key/value data throughsetPermissions depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 118 is a flowchart of a process for a JTC ApplicationMediatorcalled with setPermissions of permission key/value data and iteratingover all ViewControllers and passing the key/value data throughsetPermissions depicted in accordance with a preferred embodiment of thepresent invention;

FIG. 119 is a flowchart of a process for a JTC ViewController calledwith setPermissions of permission key/value data and iterating over thepermission keys, identifying the corresponding components, containersand beans, and applying the value to the components, containers andbeans, depicted in accordance with a preferred embodiment of the presentinvention; and

FIGS. 120-123 illustrate example patterns using the architecturalpattern of the present invention depicted in accordance of a preferredembodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

I. Hardware

With reference now to the figures, FIG. 1 depicts a pictorialrepresentation of a distributed data processing system in which thepresent invention may be implemented. Distributed data processing system100 is a network of computers in which the present invention may beimplemented. Distributed data processing system 100 contains a network102, which is the medium used to provide communications links betweenvarious devices and computers connected together within distributed dataprocessing system 100. Network 102 may include permanent connections,such as wire or fiber optic cables, or temporary connections madethrough telephone connections.

In the depicted example, a server 104 is connected to network 102 alongwith storage unit 106. In addition, clients 108, 110, and 112 also areconnected to a network 102. These clients 108, 110, and 112 may be, forexample, personal computers or network computers. For purposes of thisapplication, a network computer is any computer, coupled to a network,which receives a program or other application from another computercoupled to the network. In the depicted example, server 104 providesdata, such as boot files, operating system images, and applications toclients 108-112. Clients 108, 110, and 112 are clients to server 104.Distributed data processing system 100 may include additional servers,clients, and other devices not shown. In the depicted example,distributed data processing system 100 is the Internet with network 102representing a worldwide collection of networks and gateways that usethe TCP/IP suite of protocols to communicate with one another. At theheart of the Internet is a backbone of high-speed data communicationlines between major nodes or host computers, consisting of thousands ofcommercial, government, educational and other computer systems thatroute data and messages. Of course, distributed data processing system100 also may be implemented as a number of different types of networks,such as for example, an intranet, a local area network (LAN), or a widearea network (WAN). FIG. 1 is intended as an example, and not as anarchitectural limitation for the present invention.

Referring to FIG. 2, a block diagram depicts a data processing systemthat may be implemented as a server, such as server 104 in FIG. 1, inaccordance with a preferred embodiment of the present invention. Dataprocessing system 200 may be a symmetric multiprocessor (SMP) systemincluding a plurality of processors 202 and 204 connected to system bus206. Alternatively, a single processor system may be employed. Alsoconnected to system bus 206 is memory controller/cache 208, whichprovides an interface to local memory 209. I/O bus bridge 210 isconnected to system bus 206 and provides an interface to I/O bus 212.Memory controller/cache 208 and I/O bus bridge 210 may be integrated asdepicted.

Peripheral component interconnect (PCI) bus bridge 214 connected to I/Obus 212 provides an interface to PCI local bus 216. A number of modemsmay be connected to PCI bus 216. Typical PCI bus implementations willsupport four PCI expansion slots or add-in connectors. Communicationslinks to network computers 108-112 in FIG. 1 may be provided throughmodem 218 and network adapter 220 connected to PCI local bus 216 throughadd-in boards.

Additional PCI bus bridges 222 and 224 provide interfaces for additionalPCI buses 226 and 228, from which additional modems or network adaptersmay be supported. In this manner, server 200 allows connections tomultiple network computers. A memory-mapped graphics adapter 230 andhard disk 232 may also be connected to I/O bus 212 as depicted, eitherdirectly or indirectly.

Those of ordinary skill in the art will appreciate that the hardwaredepicted in FIG. 2 may vary. For example, other peripheral devices, suchas optical disk drives and the like, also may be used in addition to orin place of the hardware depicted. The depicted example is not meant toimply architectural limitations with respect to the present invention.

The data processing system depicted in FIG. 2 may be, for example, anIBM RISC/System 6000 system, a product of International BusinessMachines Corporation in Armonk, N.Y., running the Advanced InteractiveExecutive (AIX) operating system.

With reference now to FIG. 3, a block diagram illustrates a dataprocessing system in which the present invention may be implemented.Data processing system 300 is an example of a client computer. Dataprocessing system 300 employs a peripheral component interconnect (PCI)local bus architecture. Although the depicted example employs a PCI bus,other bus architectures such as Micro Channel and Industry StandardArchitecture (ISA) may be used. Processor 302 and main memory 304 areconnected to PCI local bus 306 through PCI bridge 308. PCI bridge 308also may include an integrated memory controller and cache memory forprocessor 302. Additional connections to PCI local bus 306 may be madethrough direct component interconnection or through add-in boards. Inthe depicted example, local area network (LAN) adapter 310, SmallComputer System Interface host bus adapter 312, and expansion businterface 314 are connected to PCI local bus 306 by direct componentconnection. In contrast, audio adapter 316, graphics adapter 318, andaudio/video adapter 319 are connected to PCI local bus 306 by add-inboards inserted into expansion slots. Expansion bus interface 314provides a connection for a keyboard and mouse adapter 320, modem 322,and additional memory 324. Small computer system interface (SCSI) hostbus adapter 312 provides a connection for hard disk drive 326, tapedrive 328, and CD-ROM drive 330. Typical PCI local bus implementationswill support three or four PCI expansion slots or add-in connectors.

An operating system runs on processor 302 and is used to coordinate andprovide control of various components within data processing system 300in FIG. 3. The operating system may be a commercially availableoperating system such as OS/2, which is available from InternationalBusiness Machines Corporation. “OS/2” is a trademark of InternationalBusiness Machines Corporation. An object oriented programming systemsuch as Java may run in conjunction with the operating system andprovides calls to the operating system from Java programs orapplications executing on data processing system 300. “Java” is atrademark of Sun Microsystems, Inc. Instructions for the operatingsystem, the object-oriented operating system, and applications orprograms are located on storage devices, such as hard disk drive 326,and may be loaded into main memory 304 for execution by processor 302.

Those of ordinary skill in the art will appreciate that the hardware inFIG. 3 may vary depending on the implementation. Other internal hardwareor peripheral devices, such as flash ROM (or equivalent nonvolatilememory) or optical disk drives and the like, may be used in addition toor in place of the hardware depicted in FIG. 3. Also, the processes ofthe present invention may be applied to a multiprocessor data processingsystem.

For example, data processing system 300, if optionally configured as anetwork computer, may not include SCSI host bus adapter 312, hard diskdrive 326, tape drive 328, and CD-ROM 330, as noted by dotted line 332in FIG. 3 denoting optional inclusion. In that case, the computer, to beproperly called a client computer, must include some type of networkcommunication interface, such as LAN adapter 310, modem 322, or thelike. As another example, data processing system 300 may be astand-alone system configured to be bootable without relying on sometype of network communication interface, whether or not data processingsystem 300 comprises some type of network communication interface. As afurther example, data processing system 300 may be a Personal DigitalAssistant (PDA) device which is configured with ROM and/or flash ROM inorder to provide nonvolatile memory for storing operating system filesand/or user-generated data.

The depicted example in FIG. 3 and above-described examples are notmeant to imply architectural limitations. For example, data processingsystem 300 also may be a notebook computer or hand held computer inaddition to taking the form of a PDA. Data processing system 300 alsomay be a kiosk or a Web appliance.

II. Overview

With reference next to FIG. 4, a diagram illustrating a model viewcontroller diagram is depicted in accordance with a preferred embodimentof the present invention. Model view control (MVC) diagram 400 includesan end-to-end section 402 in which the view is represented by client404, the control is represented by mid-tier logic 406 and the model isrepresented by persistence storage 408. Section 410 is a graphical userinterface (GUI) component architecture in which the view are Javacomponents 412, the control are event listeners 414, and the model areJava models 416. GUI components 410 may be currently embodied in systemssuch as the Java Foundation Classes (JFC) from Java.

In accordance with a preferred embodiment of the present invention, thepresent invention provides an architectural pattern for views in theclient, for naviagation of views in the client, for placing andpresenting views in a client, for issuing requests for differentconcurrent servers and services from the client, for issuing requestsfor client platform services from the client, for using multipleconcurrent data model types in the client, for issuing multiple messageformats from the client, for using multiple protocols in the client andfor specific partitioning of these pattern components in the client,such as client 404. In particular, section 418 in these examplessignificantly defines and enhances and includes a view as Java AbstractWindows Toolkit (AWT)/(JFC) 420, a control as screen control 422, and amodel as transactions 424. AWT is a tool kit containing primitives forbasic windowing functionality. These primitives include user interfacefunctionality, such as window and dialogue box manipulations, textrendering, buttons, check box, and radio button creation andmanipulation, as well as graphics primitives such as line drawing, colorchoice. Virtually all sophisticated graphics and user-interface toolsare built upon these primitives. The Java foundation classes (JFC) is apackage containing, among other things, primitives for windowingfunctionality that provide a rich superset of AWT. These primitives orcomponents include everything that the AWT provides along with a richsuperset of new primitives, including, for example, tree view, tabbedpanes, hypertext markup language (HTML) text views, etc. Java AWT/(JFC)420 could be described through section 410.

Object-oriented design depends heavily on the class concept and therelationships between various classes. A class is an abstraction of anobject that contains both attributes (data) and behavior (methods). Eachnew object created from a class is referred to as an instance of thatclass. In other words, the class is an abstract encapsulation mechanismwhile an instance is a particular object created from the class. If amethod in a class is called, it is sometimes said a message is sent toan object.

Classes are organized into inheritance hierarchies where a parent classmay have one or several subclasses. The subclasses share all the dataand methods from the parent class and any other ancestor class in theinheritance tree. The search for the appropriate methods to be usedstarts at the class for the object and proceeds up the tree as necessaryto find the desired method (the name and parameters of the method mustmatch exactly). Multiple inheritance means that a class can have two ormore parent classes. Some programming languages (e.g., C++) supportmultiple inheritance while others (e.g., Smalltalk) do not. Multipleinheritance is difficult to manage, so some languages (e.g., Java)provide a mechanism called interfaces that provide a type orientedmechanism to achieve a similar functionality without incurring theimplementation burdens. The class hierarchy diagram is based on a Javaimplementation and makes extensive use of the interface mechanism.

III. Architectural Pattern

The present invention provides a method, apparatus, and instructions foran architectural programming pattern and implementation. Thearchitectural pattern of the present invention is illustrated as a Javaimplementation for building thin (or thick) client applications and isalso referred to as “JTC.” JTC is a process, architectural pattern, andimplementation to guide developers on how to build applications, and inparticular, Internet style thin clients. JTC adapts to Internet changesrapidly. JTC increases developer discipline by providing a commonrepeatable programming pattern. JTC facilitates project management byproviding for concurrent development of the client. JTC facilitatesproject management by providing for concurrent client and server(s)development. JTC provides for a natural partition of various programmerskills. JTC has a formula based approach for cost estimates. JTCprovides-multi-channel support (ATM, Internet, Kiosk, Extranet, Mobile,Branch, Call Center, Business partners, etc.). JTC supports mobile userdisconnected mode. JTC provides natural support for multiple serverswith reduced code level cohesion and coupling. JTC provides naturalsupport for multiple data models such as, for example, XML, DHTML,Objects, Key/Value, EJB, streaming and asynchronous. JTC has naturalsupport for multiple protocols, such as, for example IIOP, RMI, Sockets,HTTP, HTTPs, and Files. JTC has natural support for client Javaaccessible RS232 devices and APIs such as currency counters, J/XFS,printers, and coin dispensers.

With reference now to FIG. 5, a diagram illustrating the components inan architectural pattern is depicted in accordance with a preferredembodiment of the present invention. Architectural pattern 500 includesa ViewController 502, which provides a display of a component, containeror bean on a data processing system. ViewController 502 basicallyprovides a reusable GUI element containing graphical components such astext fields, labels, buttons, tables, images, beans, etc. to bedisplayed for viewing and interacting by a user. ValidationRules 504 areused to validate and format the user entry into components containedwithin the ViewController. For example, ValidationRules 504 may beapplied to a single text field or to groups of text fields used for userentry. If a violation of a rule occurs, ValidationRuleException 506 isgenerated. User inputs occur on the components, containers and beanscontrolled by ViewController 502. This user input is in the form of anAWTEvent 508 in the depicted examples. The AWTEvent 508 may be, forexample, the click of a mouse button selecting a graphical button suchas an “okay” button. In response, ViewController 502 will fire ViewEvent510. ViewEvent 510 will contain major and minor codes that add moresemantics than the AWTEvent 508. The changed data that may have beenmodified or entered by user or a reference to the data model may also besupplied for further semantics. AWTEvents 508 are not visible outside ofthe ViewController 502.

Next in architectural pattern 500, ApplicationMediator 512 is a form ofa ViewListener in the depicted examples. ApplicationMediator 512 is theinterface used to specify default behavior to control ViewController 502as well as other ApplicationMediators 512. ApplicationMediator 512 willalso mediate between ViewController 502 generated ViewEvents 510 andPlacementListener 514, TopListener 516 and Transporter 524. In thispattern, PlacementListener 514 is employed to manage theplacement/containment of ViewControllers, such as ViewController 512 onthe screen of a computer. PlacementListener 514 will manageViewController 502 in response to a PlacementEvent 518 received fromApplicationMediator 512. For example, for a given component, containeror bean represented by ViewController 502, PlacementListener 514 willcontrol how ViewController 502 is placed on a screen, such as possiblyin the south of a frame with a border layout.

ApplicationMediator 512 controls the ordering of ViewControllers, notthe placement of ViewControllers. As a result, complete separationbetween view creation and layout by ViewController 502, view orderingand mediation by ApplicationMediator 512, and view placement byPlacementListener 514 is provided. This mechanism in architecturalpattern 500 increases the reusability of ViewControllers,ApplicationMediators, and PlacementListeners. PlacementEvent 518 is usedto notify PlacementListener 514 if ViewController needs to be adjustedon the screen.

Next, TopListener 516 is an interface that performs specific desktopduties, such as, for example, the launching of an application,performing a desktop shutdown, displaying a message on the desktop,displaying a context sensitive title on the desktop or reconfiguring andnon-intrusive observing the JTC application. TopEvent 520 is used tosend a message to the TopListener to indicate that some action is neededon the desktop.

A desktop provides the operating-specific functionality of a windowingsystem and application management. For example, in Windows 95, thegraphical interface that starts up is called a “desktop”. The Windows 95GUI itself is the “desktop system”. Additionally, a desktop applicationprovides a view or window in which an application may run and launchother applications. This is typically accomplished by a display of ahierarchical list of applications, which may be selected and “launched”.

ApplicationMediator 512 may generate and receive RequestEvents, such asRequestEvent 522. A RequestEvent, as used herein, represents a“lightweight transaction” that is used as an indication that an eventand a service is required to process the event. A RequestEvent 522 isidentified by major and minor codes. In addition, a reference to a datamodel may be included for additional semantics. In turn, Transporter 524in architectural pattern 500 is used to map RequestEvents, such asRequestEvent 522, to Destinations 528, 530, and 532. In other words,Transporter 524 acts as an event broadcast mechanism withinarchitectural pattern 500. Transporter 524 will route RequestEvents,such as RequestEvent 526 to various Destinations, such as Destination528, Destination 530, or Destination 532. These destinations willinterpret the RequestEvent 526, locate a server, create a messageformat, create a protocol and deliver the information to the server'sservice for processing. These response data will be returned to theTransporter 524 in a RequestEvent, such as RequestEvent 526. In turn,Transporter 524 will return the RequestEvent to ApplicationMediator 512,which will process the data contained in the event accordingly. Forexample, the return data may be sent to ViewController 502 to refreshthe view displayed on the screen to the user. If an error occurs, aRequestException 534 may be generated and returned to Transporter 524and returned to the ApplicationMediator 512.

The ApplicationMediator 512 can fire RequestEvents to the Transportersynchronously, asynchronously and repeating asynchronously. Asynchronous RequestEvent will block the ApplicationMediator and eitheran error RequestEvent will contain the results. An asynchronousRequestEvent will return immediately. The error RequestException or apossibly modified RequestEvent will later be “called back” to theApplicationMediator at the requestException and requestResponseinterface, respectively.

In depicted examples, a type Object data, such as Data 536 may be passedin reference by ViewController 502 to a Destination such as Destination1 528. This data is passed via different events, such as ViewEvent 510,RequestEvent 522, and RequestEvent 526. Changed data, such as Data 538may be returned from a Destination to ViewController 502 for display.This type Object data may take various forms, such as Extensible MarkupLanguage (XML), String, Hypertext Markup Language (HTML), key/value,Remote Method Invocation (RMI), J/XFS, RS232, etc. The ViewControllerreads and modifies the Object data but does not create the data and theDestination creates, reads and modifies the Object data and sends it toand receives it from a server.

In addition, architectural pattern 500 also includes a Factory 540,which is used to allocate objects. Factory 542 is employed to alsoallocate singleton objects.

JTC 544 the system also contains a JTC interface implemented by allmajor objects in a JTC application including ApplicationMediator,ViewController, Destination and Transporter. Together, the objectsimplementing the JTC interface give the external appearance of a singleapplication as they implement and propagate the required JTC interfacemethods.

The architectural pattern separates ViewController 502 (GUI view) fromApplicationMediator 512 (GUI state transition) from PlacementListener514 (GUI placement) from RequestEvent 522 (lite transaction) creationfrom Destination 528 (transaction dispatch) from data creation 528, fromdata usage 502, and from transaction fulfillment.

The JTC interface of the present invention provides automaticnon-intrusive tracing of application, and automatic non-intrusive eventlogging of application.

The ValidationRules provide class separation of chained field validationlogic from both GUI and data model. Also the ValidationRules can run onclient, server, or both.

The Destinations provide plugable data model, network protocol, andmessage format modules for remote or local fulfillment. Further,Destinations can support both local and remote configurations inaddition to multiple chains of them being called FIFO. The simpler theDestinations, the thinner the application. The more complex theDestinations, the thicker the application.

The ApplicationMediators can be nested. Placement Listeners provide forpartitioning of how to place components on the screen from what thecomponents are and what order they arrive. RequestEvents (litetransactions) can be broadcast to multiple servers using multiplenetwork protocols with various data and message formats.

The architecture also provides permission keys to support intra andinter ViewController and ApplicationMediator user ID and/or groupenabling and disabling, and provides settable generic field level, focuslevel, and RequestEvent level ValidationRule invocation.

The ViewControllerBaseImpl provides a mechanism to switch betweenvarious graphics containers. The example code described herein isillustrated in Java, but the processes of the present invention may beapplied to other programming languages.

IV. Class Hierarchy

With reference now to FIG. 6, a diagram illustrating classes in a classhierarchy is depicted in accordance with a preferred embodiment of thepresent invention. Class hierarchy diagram 600 illustrates the classhierarchy of new classes introduced by the present invention. All of theclasses are inherit from the class java.lang.Object. These classesprovide an architectural pattern for client development in Java. Theclasses illustrated in class hierarchy diagram 600 contain interfacesand classes to support the architectural pattern of the presentinvention. Although the depicted examples are illustrated with respectto Java, the architectural pattern of the present invention may beapplied to other types of programming environments. The depictedexamples are not meant to be limitations on the programming environmentin which the present invention may be applied.

With reference now to FIG. 7, a unified modeling language diagram isdepicted in accordance with a preferred embodiment of the presentinvention. Unified modeling language (UML) diagram 700 is a diagramillustrating the class hierarchy between various classes and interfaceswithin the architectural pattern of the present invention.

UML diagram 700 uses the following conventions. A sub-interface ofanother interface (e.g., ViewController 702 to JTC 742) or a subclass ofanother class (e.g., ViewControllerImpl 704 to ViewControllerBaseImpl706) is shown by a solid line from the subclass to the parent classwhere there is an open arrowhead. If a class is used to implement aninterface, then a dashed line goes from the class to the arrowhead atthe interface (e.g., ApplicationMediatorImpl 720 to ApplicationMediator718). A class or interface may be aggregated into another; this isindicated by a solid line connecting to a small diamond (e.g., ViewEvent714 to ViewListener 718). The end with the small diamond represents theclass that is aggregating (or containing) the class at the other end.The multiplicity of the association is indicated by numbers at each endof the line, such as ViewEvent having multiplicity of 0 to many (with“many” indicated by “*”) and ViewListener 718 having multiplicity one.So each instance of a ViewListener 718 may contain zero or moreinstances of ViewEvent 714.

Occasionally, alternative methods may be present for implementing anobject. For example, ViewControllerBaseImpl 706 may implement aContainer by either using the Java Abstract Window Toolkit (AWT) Panel707 or a JFC 709. The small dashed lines indicate a choice.

Turning now to a discussion of the classes illustrated in FIGS. 6 and 7,ViewController 702 is an interface that defines an interface for a classthat will be a single Component containing user interface componentsthat are logically related to show information to the user and takeinput from the user. In particular, ViewController 702 is a publicinterface that defines reusable graphics components as part of anoverall client application.

With reference now to FIGS. 8A and 8B, diagrams illustrating variablesand methods in ViewController 702 are depicted in accordance with apreferred embodiment of the present invention. The abstractViewControllerImpl class implements the ViewController interface toprovide default behavior where possible. The user can subclassViewControllerImpl so that not all of the interface methods ofViewController need be implemented.

The ViewControllerImpl 704 is an abstract class implementation ofViewController. ViewControllerImpl 704 and ViewController 702 are thebasic GUI building blocks for thin clients. ViewControllerImpl 704provides the function that will be required by a subclass (not shown)ViewControllerImpl 704 is controlled and mediated by anApplicationMediator. ViewControllerImpl 704 extends theViewControllerBaseImpl class and implements the ViewController interfaceso as to support the event handling methods and provide a defaultimplementation for the other ViewController methods. This classmaintains a reference to the client data model, the user validationlevel, and the UI properties and resources. Methods are present to addand remove listeners for view events generated, fire (send) view eventsto the appropriate listeners, cleanup list of event listeners on clearand exit, and enable or disable the panel.

With reference now to FIGS. 9A-9E diagrams illustrating variables,constructors, and methods for ViewControllerImpl 704 are depicted inaccordance with a preferred embodiment of the present invention. Table900 in FIG. 9A illustrates the variables used in ViewControllerImpl 704.The tables used to describe the class include a name of the variable,constructor, or method, a declaration for the variable, and adescription for the variables. Table 902 in FIG. 9B contains a similartable for the constructor used in ViewControllerImpl 704. Table 904 inFIGS. 9C-9E provides a list of the methods used withinViewControllerImpl 704. Similarly, table 904 includes a name for themethod, a declaration used for the method, and a description of themethod.

ViewControllerImpl 704 is usually a Java Component or Container or beanwith the extra methods specified here. The basic operation of aViewControllerImpl is handles using the following steps: (1) implementthe ViewController and JTC interfaces; (2) add your bean specificmethods; (3) create and compose GUI; (4) return the Component ingetComponent( ); (5) return and set permission keys, resources andproperties when asked; (6) update permission keys, resources andproperties when asked; (7) handle internal AWT events; (8) validate andformat fields with ValidationRules; (9) issue ViewEvents for semanticinterpretation; (10) return to the AWT Thread as soon as possible; (11)handle refresh(data) calls by updating GUI; (12) access data; and and(13) repeat from step (3).

ViewControllerImpl 704 is controlled and mediated by anApplicationMediator. The default function provided by this classincludes: from ViewController interface: add/remove ViewListener,fireViewEvent, setValidationLevel, refresh, getComponent, and AWTEventthreading. From the JTC interface, the functions provided include:clear, exit, set/getEnabled, set/getVisible, and toString.

ViewControllers know the full semantics of the data model being used,even though only a generic Object data; type reference is provided. TheViewControllers will cast generic reference into Class based dataobjects. Some design principles to use in ViewControllers when decidinghow to communicate information to ViewListeners are described below.

A ViewEvent is created, its setter methods are called, and it is firedto the ViewListeners. The listeners interpret the major and minor codesto decided what to do.

To provide additional information, the ViewController can set a Javadata object in the ViewEvent using the setData method. The datareference can be simple String objects or user defined data objects.

A similar approach to provide additional information is for theViewController to supply application defined objects using the setDatamethod. The data reference are more complex than simple objects (i.e.Customer, AccountInfo, Schematic, CarSpec, etc.)

The ViewController also can provide named methods. For example, aViewListener may call customerVC.getCustomerName( ) to retrieve thecustomer name. The implementation of getCustomerName is hidden by theViewController and could involve manipulating several Java Components.In addition, setters may also be provided, such asVC.setCurrentCustomer( ). In general, too many named methods may suggestthat information sharing should be via data objects within ViewEventsand refresh methods instead. The use of named methods may reduce reuseof a ViewController by an ApplicationMediator.

The ViewController may listen to property change events on a data modelusing standard Java mechanisms. Thus, the ViewListeners, theViewControllers, or any other interested object can communicate via thedata model changes. In general, this is very data-oriented object modelprogramming approach and can lead to object-spaghetti code. Changes inthe data model ripple throughout the application.

ViewControllerBaseImpl 706 is an abstract class and is a superclass ofViewControllerImpl 704. This class provides the indirection to allowspecification of the Component type of the ViewController via a “has a”and/or “is a” relationship. The idea is for the developer to replacethis class entirely with the developer's own implementation. Thisreplacement may be accomplished by creating the developer's ownimplementation of ViewControllerBaseImpl that implements the methodsgetComponent( ), setEnabled(boolean enable), and setVisible(booleanvisible). ViewControllerBaseImpl 706 is generally used with eitherJPanel 707 or a java.awt.Panel 707 by changing the inherits statement.ViewControllerBaseImpl may also be used with any Java or user-definedcomponent or container. The variables, constructors, and methods forViewControllerBaseImpl 706 are found in FIGS. 10A-10C. The variable forViewControllerBaseImpl 706 is found in table 1000 in FIG. 10A while theconstructors are listed in table 1002 in FIG. 10B. The methods arelisted in table 1004 in FIG. 10C.

ViewControllerAdapter 708 is an abstract class and is a helper adapterclass that fits between ViewControllerImpl 704 and the developer'ssubclass. ViewControllerImpl 704 implements almost all of the standardJava AWT listeners and provides empty methods. This class allowsViewControllers to be implemented without having to specify all of themethods of a Java AWT listener interface when a subclass being createdneeds only one such method.

ViewControllerAdapter 708 implements the following AWT event listeners:AdjustmentListener, ComponentListener, FocusListener, ItemListener,KeyListener, MouseListener, TextListener. This class knows abouteverything that ViewControllerImpl knows, and also knows the defaultempty implementation of AWT event listener methods. The methods on theclass allow for adding and removing of listeners for view eventsgenerated, firing (sending) of view events to the appropriate listeners,cleaning up the list of event listeners on clear and exit, and enablingor disabling the panel.

FIGS. 11A-11C illustrate a variable, a constructor, and methods forViewControllerAdapter 708. Table 1100 in FIG. 11A illustrates thevariable while table 1102 in FIG. 11B illustrates the constructor ofViewControllerAdapter 708. Methods for ViewControllerAdapter 708 areshown in table 1104 and FIG. 11C.

ValidationRule 710 is an abstract class for class-based value validationrules used to validate and format ViewController contents. Validation isnormally used for single or groups of text fields (user entry) Examplesinclude range checking, date, social security number, or other businessspecific formats. The definition of the validation rules are kept out ofthe data models and ViewControllers to maximize reuse of validationlogic. These types of objects only encode which rule to use.

Typically, validation rules have two methods: (1) edit and (2)normalize. The edit method is used to input a string, validate the valueand output the view friendly formatted string. The normalized method isused to input a string, validate the value and output a string that willbe set into the data model and/or transmitted via a RequestEvent to adestination. For example, given a value of “1000.0”, edit will produce“$1,000.00” and normalize will produce “1000”. The ValidationRule 710provides two static helper functions to apply edits or normalizes on allinput string given a list of edit rule class names. This is calledValidationRule chaining. In this manner, ValidationRule 710 allows adeveloper to keep the implementations of validation rules small andsimple so as to maximize reuse of validation code. Additionally,ValidationRule 710 may be run on a server. The methods can create aninstance of a ValidationRule given a class name, apply edit rulessequentially on a string given a list of ValidationRule class names, orapply normalize rules sequentially on a string given a list ofValidationRule class names. Invocation of a validation rule is initiatedby the ViewController or some business logic method. In case of failure,a ValidationRuleException is thrown.

With reference now to FIGS. 12A-12C, drawings illustrating variables,constructors, and methods for ValidationRule 710 are depicted inaccordance with a preferred embodiment of the present invention. Thevariables are illustrated in table 1200 in FIG. 12A while theconstructor is shown in table 1202 in FIG. 12B for ValidationRule 710.The methods used in ValidationRule 710 are shown in table 1204 in FIG.12C. FIG. 12D contains code 1206, which is used to apply ValidationRulesfor classes in response to ValidationRule 710 being given a list ofclass names for processing). Code 1206 will apply each ValidationRulefor a class and return a formatted result. A similar code is used forValidationRule. applyNormalizes.

ValidationRuleException 712 is a class that extends the Exception classin Java to represent the type of exceptions thrown by rules defined inValidationRule 710. ValidationRuleException 712 is generated when avalidation rules has failed. The cause of the failure is contained inthe exception. In the depicted examples, processing of remainingvalidation rules will halt. This class needs to know the validation ruleexception string.

With reference now to FIGS. 13A and 13B, tables illustrating variablesand constructors for a ValidationRuleException are depicted inaccordance with a preferred embodiment of the present invention. Table1300 in FIG. 13A illustrates a variable while table 1302 in FIG. 13Billustrates constructors for ValidationRuleException 712.

ViewEvent 714 is a class having a mechanism used for communicationbetween ViewControllers and ViewListeners, such as ApplicationMediatorsand between ApplicationMediators. Notification occurs when a significantAWTEvent has occurred that the ViewController cannot handle. BothViewControllers and ApplicationMediators can fire ViewEvents. TheViewEvent state includes a major code, a minor code, a source Object ofthe event, and a generic Object data reference. Numerous predefinedmajor codes and minor codes are provided and a subclass can defineadditional application specific codes.

When a ViewController fires a ViewEvent, it is handled in theApplicationMediatorImpl superclass first and then forwarded to theApplicationMediatorImpl subclass in the processViewEvent method. Thismechanism allows threading and queuing to be handled by the superclass.Dispatching a ViewEvent to a subclass is performed in one of two ways:queued-event dispatching and thread-event dispatching.

With reference now to FIGS. 14A-14D, diagrams illustrating variables,constructors, and methods for ViewEvent 714 are depicted in accordancewith a preferred embodiment of the present invention. Table 1400 inFIGS. 14A-14D illustrates variables for ViewEvent 714. Table 1402 inFIG. 14E shows the constructors for ViewEvent 714. The methods forViewEvent 714 are shown in table 1404 in FIG. 14F.

ViewListener 716 is an interface for receiving ViewEvents generated byViewControllers. The listener will be called back on theviewEventPerformed method. ViewListener 716 interprets the values fromthe ViewEvent and decides what action to take. If more information needsto be conveyed, ViewListener 716 gets the data variable. A ViewListenercan set the ViewEvent to be consumed. When the ViewEvent is consumed,the ViewEvent will not be forwarded to other ViewListeners.

Turning now to FIGS. 15A and 15B, diagrams illustrating a variable and amethod for ViewListener 716 are depicted in accordance with a preferredembodiment of the present invention. The variable for ViewListener 716is shown in table 1500 in FIG. 15A. The method used in ViewListener 716is shown in table 1502 in FIG. 15B.

ApplicationMediator 718 is an interface that specifies methods for themanagement of PlacementListeners, ViewListeners, RequestListeners,TopListeners, permissions, properties, resources, visibility, validity.ApplicationMediator 718 also defines a generic method to refresh data.ApplicationMediator 718 defines the interface for a class that willmediate multiple ViewControllers or other ApplicationMediators. Methodsare provided in this class to add and remove PlacementListeners for theViewControllers, to add and remove TopListeners for theApplicationMediator, to add and remove RequestListeners forRequestEvents generated, and to add and remove ViewListeners forViewEvents passed up from the ViewControllers. Other methods in theApplicationMediator 718 set the data used by the ViewControllers, tellwhere and how to handle ViewEvents generated by ViewControllers, andgenerate RequestEvents based on some application logic of ViewEvents.Methods are provided in this interface to set the property informationand the resources used by the ViewControllers.

The FIGS. 16A and 16B, diagrams illustrating a variable and methods forApplicationMediator 718 are depicted in accordance with a preferredembodiment of the present invention. Table 1600 in FIG. 16A illustratesthe variable used for ApplicationMediator 718 while table 1602 in FIG.16B illustrates the methods used in ApplicationMediator 718.

ApplicationMediatorImpl 720 is an abstract class, implements theApplicationMediator interface, and provides default behavior to manageViewControllers, ApplicationMediators, add/fire/remove ofPlacementListeners, RequestListeners, ViewListeners and TopListeners. Asubclass of ApplicationMediatorImpl 718 should focus on managing thestate machine for ordering the ViewControllers it creates and themediating of events. This focus includes determining whichViewController to allocate, which ViewController to make visible, whento fire a PlacementEvent, when to fire a RequestEvent, and when to firea TopEvent. A default list is provided to hold ViewControllers. Thedefault list is a Vector and is directly available to subclasses. AnApplicationMediatorImpl 720 may create other ApplicationMediators. As aresult, a list to hold ApplicationMediators also is provided.

The helper methods initApplicationMediators and initViewControllers willload their respective classes and store them in Vectors. The helpermethods getAM, getVC, setAM, and setVC provide a way to get/set theelements in the Vectors.

When a ViewController fires a ViewEvent, the ViewEvent is handled inApplicationMediatorImpl 720 first and then forwarded to the subclass(not shown) in the processViewEvent method. This process allowsthreading and queuing to be handled first by ApplicationMediatorImpl720.

ApplicationMediatorImpl 720 needs to have reference to the client datamodel, PlacementListeners, TopListeners, ViewListeners, ViewControllers,other ApplicationMediators, UI properties and resources, and Eventprocessing threads.

Methods are provided in ApplicationMediatorImpl 720 to add and removelisteners for ViewEvents generated or forwarded from a ViewController,to fire (send) ViewEvents to the appropriate listeners, to add andremove listeners for RequestEvents generated, and to fire TopEvents andto fire (send) synchronous or asynchronous RequestEvents to theappropriate listeners. Other methods add and remove listeners forPlacementEvents generated, fire (send) PlacementEvents to theappropriate listeners, and cleanup a list of event listeners and eventprocessing threads on clear and exit. It is also possible to enable ordisable the visibility, create, initialize, and manage ViewControllers,and to create, initialize, and manage other ApplicationMediators. Othermethods get references of all JTC objects managed, set client datareferences for all ViewControllers and ApplicationMediators managed, addTopListeners, and handle the processing of a received ViewEvent in aseparate thread (either in a queue fashion or unique thread per event).

Turning next to FIGS. 17A-17E, diagrams illustrating variables and aconstructor for ApplicationMediatorImpl 720 are depicted in accordancewith a preferred embodiment of the present invention. Table 1700 in FIG.17A illustrates variables for ApplicationMediatorImpl 720 while table1702 in FIG. 17B shows the constructor used in ApplicationMediatorImpl720. Table 1704 in FIGS. 17C, 17D, and 17E illustrate the methods usedin ApplicationMediatorImpl 720.

With reference now to FIGS. 17F-17I, diagrams illustrating code used inmethods for ApplicationMediatorImpl 720 are depicted in accordance witha preferred embodiment of the present invention. In FIG. 17F, code 1706illustrates code used in an exit method for ApplicationMediatorImpl 720.This code allows the ApplicationMediator to be exited by exiting allallocated ViewControllers and ApplicationMediators. All data will be setto null by code 1706 and all lists destroyed.

In FIG. 17G, code 1708 illustrates code used to clear anApplicationMediator by clearing all allocated ViewControllers andApplicationMediators. The data is set to null, but the lists are notdestroyed. A cleared ApplicationMediator can be used again. In FIG. 17H,code 1710 is used to initialize an ApplicationMediator using thelisteners of an existing ApplicationMediator. In FIG. 17I, code 1712 isused to refresh an object. This code is used to refresh ViewControllersand ApplicationMediators when new data arrives. In FIGS. 17J-17M,depicts code 1714 which is used to handle the event dispatch.

PlacementEvent 722 is a class used to notify PlacementListeners that aViewController needs to be adjusted on the screen. The value stored in aPlacementEvent 722 are: (1) major code indicating the placement type;(2) minor containing additional information; (3) source, which indicatesthe sender of the event; (4) Component, which is the ViewController'scomponent; and (5) data, which is a generic Object data, containing thetype to pass more information and is typically not the same type of datasent in ViewEvents and RequestEvents. Predefined placement types, whichare used as major codes include, for example, add, remove, and modify. Asubclass may define more application specific PlacementEvent codes.Additional information may be conveyed through the use of the minorvariable or by supplying real data.

With reference now to FIGS. 18A-18C, diagrams illustrating variables,constructors, and methods for a PlacementEvent are depicted inaccordance with a preferred embodiment of the present invention. Table1800 in FIG. 18A illustrates variables used within PlacementEvent 722while table 1802 in FIG. 18B show constructors used for PlacementEvent722. Table 1804 in FIG. 18C shows the methods used within PlacementEvent722.

PlacementListener 724 is an interface used to manage the placement ofViewControllers on the screen. For a given component or container, suchas a ViewController, PlacementListener 724 controls the placement whileApplicationMediator controls the ordering of ViewControllers instead oftheir placement. For example, if a designer wishes to create a splitpane with a tree in the left pane that allows selection ofApplicationMediators, ViewControllers will display on the right. As aresult, an “add” method is called to the split pane. If a frame is used,“add” has a different syntax. An object handling placement of componentswill register as a listener for notifications to place objects on thescreen. This role is the one played by PlacementListener 724. TheApplicationMediator controls the ordering of ViewControllers, not theirplacement. A PlacementListener adds itself to a PlacementEvent generatorand is called back with a PlacementEvent which indicates a desiredaction. This mechanism allows complete separation between view creation(ViewController), view ordering (ApplicationMediator), and viewplacement (PlacementListener). This arrangement increases thereusability of ViewControllers and ApplicationMediators to nearly 100%with respect to placement.

With reference now to FIGS. 19A and 19B, diagrams illustrating avariable and method for a PlacementListener are depicted in accordancewith a preferred embodiment of the present invention. Table 1900 in FIG.19A illustrates the variable used in PlacementListener 724 while table1902 in FIG. 19B illustrates the method used in PlacementListener 724.

TopEvent 726 is a class used to notify TopListeners thatApplicationMediator needs some desktop function to occur. The valuestored in TopEvent include: (1) major, which identifies the TopEventtype; (2) minor, which contains additional information; (3) source,which identifies the sender of the Event; (4) consume, which will resultin the Event being processed if true; and (5) data, which is a genericobject data used to pass more information. Predefined types, which areused as major codes include, for example, EXEC, BROWSER, TITLE, STATUS,and OS. This category of types is used for interaction with the desktop(operating system, browser, other applications). Additional major codesinclude TRANSPORTER, DESTINATION, APPLICATION_MEDIATOR, REQUEST_EVENT,VIEW_CONTROLLER, VIEW_EVENT, TOP_LISTENER, TOP_EVENT,PLACEMENT_LISTENER, PLACEMENT₁₃ EVENT, MAJOR, MINOR, AWT_EVENT, and JTC.This category of types is used to indicate a reconfiguration of the JTCapplication. Additional TopEvent codes may be defined through the use ofsubclasses. Additional information may be conveyed by using the minorvariable or supplying real data.

With reference now to FIGS. 20A-20C, diagrams illustrating variables,constructors, and methods for a TopEvent are depicted in accordance witha preferred embodiment of the present invention.

Table 2000 in FIG. 20A illustrates the variables contained in<updatethis tabled based on latest javadoc contents>TopEvent 726 while table2002 in FIG. 20B shows the constructors for TopEvent 726. The methodsfor TopEvent 726 are found in table 2004 in FIG. 20C.

TopListener 728 is an interface that performs business specific desktopduties for a display. TopListener 728 provides an interface that ishighly customizable for each business application. This interfacespecifies a topEventPerformed method to receive a TopEvent encoding atask to be performed.

With reference now to FIGS. 21A and 21B, diagrams illustrating avariable and methods for TopListeners are depicted in accordance with apreferred embodiment of the present invention. Table 2100 in FIG. 21Aillustrates the variable for TopListener 728 while table 2102 in FIG.21B illustrates the methods in TopListener 728.

The RequestEvent 730 is a class that extends EventObject to representRequestEvents generated by ApplicationMediators. This class represents alite-weight transaction. The instances of this class denotes a unit ofwork. RequestEvent 730 represents a request for a transaction or datafrom a source external to the application. The request is handled by aremote or local destination. The Transporter is responsible for mappingRequestEvents to Destinations. The state of a RequestEvent 730 includesthe following information: (1) major code identifying a family ofRequestsEvents; (2) minor code identifying a specific request under thefamily); (3) version, which is usually user defined; (4) status whichmay be an appended string showing the stages of processing; (5) consume(a consumed Request Event will cause JTC to stop processing the RequestEvent); and (6) data, which may be, for example a reference to genericObject data. A RequestEvent can be set to be consumed in which caseDestinations and the Transporter will halt forwarding of theRequestEvent and return control to the ApplicationMediator.

Turning now to FIGS. 22A-22C, diagrams illustrating a variable,constructors, and methods for RequestEvent are depicted in accordancewith a preferred embodiment of the present invention. Table 2200 in FIG.22A illustrates the variable in RequestEvent 730. Table 2202 in FIG. 22Bshows the constructors used in RequestEvent 730. Table 2204 in FIG. 22Cillustrates the methods in RequestEvent 730.

RequestException 732 is a class that extends Exception to represent thetype of exception thrown when there is a problem in submitting aRequestEvent. This class is used when the processing of a RequestEventcauses an error condition. This exception can be thrown directly when asynchronous or asynchronous RequestEvent is performed. This indicatesfailure in synchronous processing or failure in the fire mechanism. Theexception can be thrown indirectly when asynchronous RequestEvent isprocessed. The cause of the failure is also indicated in the exceptionin the depicted examples. Thus, this class needs to know the stringrepresenting the reason for the RequestEvent exception.

With reference now to FIGS. 23A-23C, diagrams illustrating a variable,constructors, and methods for RequestException 732 are depicted inaccordance with a preferred embodiment of the present invention. Table2300 illustrates the variable for RequestException 730 while table 2302in FIG. 23B illustrates the constructors used in RequestException 732.The methods for RequestException 730 are found in table 2304.

The RequestListener 734 is an interface that defines the method for aclass to implement for receiving synchronous or asynchronousRequestEvents. This interface is implemented by classes that want tolisten and be notified when a RequestEvent is fired. A typical exampleis a Transporter instance. The RequestListener is added to anApplicationMediator as a listener for RequestEvents. Two styles ofnotification are possible: synchronous and asynchronous. The Transporterimplements the RequestListener interface to map RequestEvents toDestinations. Other classes can implement the RequestListener interfaceand register for RequestEvents to monitor them. A RequestException canbe thrown directly when invoking synchronous and asynchronousRequestEvents or on a callback when invoking only asynchronousRequestEvents.

With reference now to FIGS. 24A and 24B, diagrams illustrating avariable and methods for a RequestListener are depicted in accordancewith a preferred embodiment of the present invention. Table 2400 in FIG.24A illustrates the variable in RequestListener 734 while table 2402 inFIG. 24B illustrates the methods used in RequestListener 734.

RequestResponseListener 736 interface is implemented by a class thatrequires asynchronous RequestEvent processing. For example, when anApplicationMediator implements this interface, it will be called back onone of the two methods after it fires asynchronous RequestEvents.Successful RequestEvents are returned through the requestResponse methodand passed a RequestEvent that may have new data. UnsuccessfulRequestEvents are returned through the requestException method and theRequestException contains the reason.

Turning now to FIGS. 25A and 25B, diagrams illustrating a variable andmethods for a RequestResponseListener are depicted in accordance with apreferred embodiment of the present invention. Table 2500 in FIG. 25Ashows the variable in RequestResponseListener 734 while table 2502 inFIG. 25B illustrates the methods in RequestResponseListener 736.

The Transporter 730 is a class that implements the JTC andRequestListener interfaces. The primary function of Transporter class730 is to map RequestEvents to Destinations. In other words, Transporter738 acts as an event broadcaster to route RequestEvents to theappropriate Destination. Typically, ApplicationMediators fireRequestEvents which are routed to a Destination by the Transporter. TheDestination processes the RequestEvent by performing some interpretationand sending them to a target, such as a server. This event broadcastingis performed by Transporter 738 based on the major code of theRequestEvent in the depicted examples. Transporter 736 needs to know theDestinations, the major codes registered by the Destinations,RequestEvents, RequestResponseListener, and RequestExceptions.

Methods are provided in Transporter 738 to register a Destination thatprocesses RequestEvents with a specific major code, remove theregistration of a Destination, receive a RequestEvent for synchronous orasynchronous processing, handle the processing of a receivedasynchronous RequestEvent in a separate thread (either in a queuefashion or unique thread per event), and return a list of Destinationsregistered for a specific key (major code). Other methods cancel theprocessing of an asynchronous RequestEvent, cleanup threads and lists ofDestinations on clear and exit, enable or disable the sending ofRequestEvents to Destinations, and enable or disable the tagging (statussetting) of RequestEvents.

With reference now to FIGS. 26A-26D, diagrams illustrating variables, aconstructor, and methods for a transporter are depicted in accordancewith a preferred embodiment of the present invention. Table 2600 in FIG.26A illustrates variables for Transporter 736 while table 2602 in FIG.26B illustrates a constructor for Transporter 738. The methods forTransporter 738 are illustrated in table 2604 in FIGS. 26C-26D.

Turning now to FIGS. 26E-26F, diagrams illustrating code used in methodsin Transporter 738 are depicted in accordance with a preferredembodiment of the present invention. Code 2604 in FIG. 26E illustratesprocessing or selecting Destinations in response to a RequestEvent.Given a RequestEvent of Destinations, code 2604 will call eachDestination in a first in first out (FIFO)/first exception first return(FEFR) order. Code 2606 in FIG. 26F illustrates a process for submittinga synchronous request. For each Destination listening for the currentfamily of RequestEvents, as indicated by the major code, theRequestEvent is sent to a Destination for processing. If a problemoccurs, a RequestException is thrown. Processing the RequestEvent willoccur as long as a RequestException being thrown is not from aDestination and the RequestEvent is not consumed. Submission of anasynchronous request is performed by code 2608 in FIG. 26G. Code 2610 inFIG. 26H illustrates code for handling executions of submits on anotherthread.

The Destination 740 is an interface used to pass results or events. Thisinterface is implemented by classes that want to listen to Transportersand send RequestEvents to servers. Destination 740 performs thefollowing functions: (1) server: locate it; (2) network transports:create the low level protocols such as sockets, RMI, URLs, Files, etc.;(3) server types: be able to talk to different servers such as EJBs,Servlets, web servers, legacy, etc.; (4) message formats: be able toturn RequestEvents and data into formats that the servers understand;(5) timeouts: finish the job in the appropriate amount of time or cancelthe operation; (6) retries: how many times should a connection be tried;(7) caching: save data until it becomes stale; (8) stale data: detectstale data; (9) heart beats: I am alive; (10) logging: save pre and postRequestEvents; and (11) objects: locate them, create them.

Example Destinations behaviors include the following: (1) serializing arequest and writing it to a socket, (2) reading and writing requests andresponses from a file for demonstrations, (3) casting the data in aRequestEvent into objects and so that RMI methods are visible, (4)debugging, (5) tracing, (6) compression, (7) encryption, and (8)translation.

A Destination 740 is first added to a Transporter as a RequestListener,listening for RequestEvents of a specific major code. When RequestEventsenter the Transporter, these RequestEvents are sent to each listeningDestination via a requestEventPerformed. Additionally, a Destinationmonitors the state of the consumed attribute of the RequestEvent andwill terminate processing when the state is true.

RequestEvents are identified by a major code (represents a family ofRequests) and a minor code (represents a specific Request). Destinationsare added to the Transporter as DestinationListeners specifying a majorcode for RequestEvents they are interested in receiving. The Destinationis called when the major code of the RequestEvent matches theDestination's major code. Multiple Destinations can listen for the sameRequestEvent major code and results of one Destination can be passed tothe next Destination. RequestEvents are processed in a first in firstout (FIFO)/first exception first return (FEFR) order.

With reference now to FIGS. 27A and 27B are diagrams illustrating avariable and methods for a Destination in accordance with a preferredembodiment of the present invention. Table 2700 in FIG. 27A illustratesthe variable in Destination 740 while table 2702 in FIG. 27B illustratesthe methods used in Destination 740.

DestinationImpl 742 is an abstract class that implements the Destinationinterface and provides a default implementation for the Destinationinterface methods. It needs to know whether the Destination is enabledor disabled, whether the RequestEvents are tagged with a status or not,and the RequestEvent processing timeout value. Methods are provided toenable or disable the processing of RequestEvents in the Destination andto set the RequestEvent processing timeout value.

With reference now to FIGS. 28A-28C, diagrams illustrating variables,constructors, and methods for a DestinationImpl are depicted inaccordance with a preferred embodiment of the present invention. Table2800 in FIG. 28A illustrates the variable used in DestinationImpl 742while table 2802 in FIG. 28B illustrates the constructor used inDestinationImpl 742. Methods for DestinationImpl 742 are illustrated intable 2804 in FIG. 28C.

In FIG. 28D, code 2806 is used to process a RequestEvent. If anapplication uses a set of objects that perform the retrieval and updateof data, then those objects can be accessed from a generic Destinationclass. Typically, a Destination implementation accesses a singleinterface class with methods and is written specifically to serve onepurpose (i.e. the retrieval and update of customer data or the retrievaland update of employee data). However, a generic Destination class canbe written to retrieve and update any set of data. The requirement isthat the class/object that serves the data must all have methods withthe same interface (in other words, they must take in the same numberand type of object as parameters and return the same type or genericobject.) This way, the Destination class can be implemented to useJava's reflection to access/create the object and invoke a particularmethod on the object. The major code of the RequestEvent can specify theclass name and the minor code can specify the method name. The code inFIG. 28D shows how a Destination can be implemented to access anEnterprise JavaBean session bean instance from an application serverusing Java's RMI and Java's Reflection capabilities. The methods on thesession beans all take a single parameter of type Object and return aparameter of type Object. The client user interface and the sessionbeans know the specific type of data objects passed but the Destinationsdo not need to know about the data.

JTC 744 is an interface that provides a top level interface in thearchitecture of the present invention. All major objects in a JTCapplication implement this interface including the driver programs thatlaunch the application/applet. This interface provides the ability toreference all objects using a single type. The behaviors expectedinclude clear, exit, getJTCs, init, is Enabled, setEnabled, andtoString. The interfaces that extending JTC are ViewController,ApplicationMediator, and Destination. The classes implementing JTC areViewControllerImpl, ApplicationMediatorImpl, Transporter, andDestinationImpl.

Of particular importance is the getJTCs( ) method. Each JTC objectreturns the other JTC objects it creates. Iteration over these objectsis possible. Inspection of the object types and addition of theappropriate listeners may be performed. This interface provides amechanism for non-intrusive logging, tracing and debugging.

Factory 746 is a class used to make objects. This class is the place forcode relating to prefetching, caching, and alternative “styles” for thenew operator (or construction of objects), or loading a serializedobject. The alternative “style” may be, for example, using Class.forName. The default behavior of a Factory includes, for example, creatinga single object. Additionally, the behavior may include returning apreviously created object if a key has been used or otherwise creating anew object and remembering the object.

Further, Factory 746 may be used to create multiple objects. Also, if akey[i] has been used, a previously created object may be returned.Otherwise, a new object [i] may be created and remembered by theFactory. For example, on a single JVM, a designer may want to create asingle shared instance of a Transporter. Each access to the Transportershould be as follows: Transportert=Factory.newInstance(com.ibm.jtc.Transporter, true). In this case, theClass.for Name method is used with the key to create an instance of theTransporter. The true value indicates that a singleton may be created.The singleton may be turned off in which case all objects created arenew and not remembered. Another key also may be used besides the classname. An example is as follows: Customer c=Factory.newInstance (“CUST”,com.abc.Customer, true). The user can create a single object or createmultiple of objects. For example, on a single JVM, a user may want tocreate and share one instance of a Transporter. The Factory class needsto know the list of singleton classes managed. The methods in this classprovide several ways to create an instance of a class given one or morefull path class name strings. The Factory class also can remove storedreferences of singleton classes.

With reference now to FIGS. 29A and 29B, diagrams illustrating variablesand methods in a Factory are depicted in accordance with a preferredembodiment of the present invention. Table 2900 in FIG. 29A illustratesthe variable used in Factory 746 while table 2902 in FIG. 29Billustrates the methods for Factory 744.

Q 740 is a class representing a queue of objects that are added andremoved in first-in first-out (FIFO) ordering. The size of the queue canbe set to a maximum or as unbounded. The structure maintains the queueof objects, the current size of queue, and the front and back ends ofthe queue. Methods are provided to add an object to the back end of thequeue, remove an object from the front of the queue, and predicates tocheck if the queue is empty or full.

JTC 744 is a top level interface, which all major objects in anapplication created using the architecture of the present inventionshould implement. This would include driver programs that launch theapplication. This interface allows referencing of objects with aconsistent type and a similar expected behavior.

Of particular importance in this class is the getJTCs( ) method. EachJTC object returns the other JTC objects it creates. With thisinterface, a process can iterate over these objects, inspect theirtypes, and add the appropriate listeners. The system may be reconfiguredthrough this interface. This reconfiguration includes, for example,disabling the Transporter, adding a priority Destination, and consumingan event. This interface provides an excellent mechanism fornon-intrusive logging, tracing and debugging. For example, if a programTest1.java implements JTC, it will return the Transporter,ApplicationMediators and Destinations it creates.

With reference now to FIGS. 30A and 30B, tables illustrating variablesand methods in a JTC is depicted in accordance with a preferredembodiment of the present invention. Table 3000 in FIG. 30A illustratesvariables in JTC while table 3002 in FIG. 30B illustrates methods forJTC.

V. Steps in Building an Application Using the JTC Architecture

A thin client application or a thick client application that follows theJTC architecture of the present invention can be built using a top-down,bottoms-up, or from the middle approach. All approaches allow forconcurrent development within the JTC client application. All approachesall for concurrent development of the JTC client application and theserver and services.

The following steps show a bottoms-up process. A proper design ofinterfaces and subsystem models, will ensure that the JTC applicationcan be implemented in parallel.

A. Design Client Application Subsystems

The key to the successful implementation of a JTC application that hasreusable and maintainable parts is the proper division of theapplication into logical subsystems. This division should be driven bythe analysis of the application's domain. For example, using anobject-oriented analysis of the application's domain, sets of use casescan be developed in the following manner. The actors external to thesystem are identified. For example, in designing an automated tellermachine (ATM) the customer using the machine would be an actor and thebank's central computer is also an actor. The use case is a set ofinteractions the actor or actors have with the system. All sequences ofinteractions, including normal and exceptional behavior, should bespecified. For example, normal behavior for withdrawing cash from an ATMwould include a sequence of prompts and customer responses thateventually lead to the dispensing of cash. Exceptions would include anunreadable card, an incorrect PIN, insufficient cash in the machine,insufficient funds in the account, etc. Use cases can include a set ofpreconditions and post-conditions. A precondition for the ATM would bepossession of an ATM card and a post condition, if the cash withdrawalis successful, would be an appropriate debit from the account balance.

The use cases produce natural divisions of function in an application.Use cases describe functions of the application that are most likely tobe reused within and outside of the application. Each use case orpossibly a group of fine-grained related use cases should make up thelogical subsystem model. Groups of ViewControllers andApplicationMediators are implemented in these subsystems. AViewController is used to represent a single reusable screen or groupingof information to be inputted and/or displayed. An ApplicationMediatormediates multiple ViewControllers for a single application function oruse case.

Other subsystems of the client application include a communicationssubsystem, a client startup subsystem, reusable graphical components,business validation rules, and enterprise policies.

The business logic and central data management of an application shouldbe separated out from the JTC application. This business logic and datacan be physically located on any machine. JTC clients typically do notkeep or manage transaction states; server side business logic managesthe transaction states. Therefore, the communications subsystem isresponsible for the sending of data requests and transaction requests tothe business logic outside of the application. This consists of theimplementation of RequestEvents and Destinations.

A client startup subsystem manages the client application lifecycle andoverall look and feel. This subsystem includes implementations ofTopListeners and PlacementListeners.

Common reusable graphical components used by user interface panelsshould be separated out in their own subsystem so that they are designedand implemented for reuse and available to other subsystems andapplications.

The rules for validating user input for display format and persistentstorage should be separated into another subsystem. This allows forcentral maintainability of the rules and reuse across all othersubsystems and applications. ValidationRules are implemented in thissubsystem.

Enterprise policies include functions related to security, login/logout,users/groups/roles, profiles, locale; and languages. These requirementscross subsystems in a consistent and easily managed manner throughmethods including set/getProperties, set/getResources,set/getPermissions. Additional non functional enterprise polices such ascaching, data pre-fetching and mobile users are implemented in commoneasily configurable Destination subsystems.

In a bottoms-up approach, the client data model should be developed nextfor the specific subsystem. This model specifies the structure andcontents of data used by the client application. There are a variety ofapproaches to a client data model: Local Object Model, Workflow ObjectModel, XML, Named Methods, Key/Value Pairs, Ordinal Positioning, RMI,etc. To optimized concurrent development with the server and services, abootstrap Key/Value data model is a sufficient and expeditious choice.

Once a data model approach is chosen, then the data objects must becreated. These can be grouped and organized at different levels ofgranularity. In general, each component, such as, for example, aViewController or an ApplicationMediator, should only reference the datathe component uses or manages. For example, a ViewController should onlyhave data required to be displayed on a single screen and the data inputby the user on that screen.

B. Create a ViewController

In these examples, a ViewController is a panel that contains onereusable screen of user display and input. This screen can eithercontain Java Abstract Windowing Toolkit (AWT) components or JavaFoundation Classes (JFC/Swing) components. The way to choose between thetwo types of components is to implement the ViewControllerBaseImplclass. The ViewControllerBaseImpl class can extend AWT's Panel class orJFC's JPanel class. Also ViewControllerBaseImpl can just contain acomponent, container or bean and return it in the getComponent( )method. In a graphical user interface, components are organized intomanageable groups through the use of containers. Additionally, acontainer may provide basic window and dialogue services. Ajava.awt.Panel itself is a pure container. A java.awt.Panel itself isnot a window in itself, but its sole purpose is to organize componentsin a window. With reference now to FIG. 31, a flowchart of a process forcreating a ViewController is depicted in accordance with a preferredembodiment of the present invention. A particular screen is selected toimplement (step 3100) and a class is created that extends one of theViewController implementation classes (step 3102). This class shouldhave a suffix of VC to distinguish it as a ViewController class. Theinit( ) method is overridden (step 3104) and replaced with code tocreate, initialize, and layout graphical components of the panel. Visualbuilders (such as IBM VisualAge) can be used to create this methodautomatically. The refresh( ) method is overridden (step 3106). In thismethod, data to be displayed will be passed in. ViewControllers shouldbe implemented to be reusable with different sets of data. By invokingrefresh(), ApplicationMediators can control for what purpose theViewController is used. The clear( ) method is overridden (step 3108).In this method, the set of data used is cleared from use and display.This allows for the ViewController to be used with another set of data.

As part of component initialization, the ViewController is added as itscomponent's event listeners (step 3110). The event listeners areimplemented for the components (step 3112). ValidationRules are used tovalidate user input from a component event (step 3114). Use ViewEvents(described below) to send user inputted data or requests for more datafrom an ApplicationMediator. The fireViewEvent method and the ViewEventlisteners are used to process the event (step 3116). If anotherViewController needs to be displayed, use a ViewEvent to represent thatrequest and have the ApplicationMediator process that request.

VIII. Create ValidationRule(s)

Turning now to FIG. 32, a flowchart of a process for creatingValidationRules is depicted in accordance with a preferred embodiment ofthe present invention. A ValidationRule implements two methods: edit andnormalize. A particular business validation rule is selected (step 3200)and a class that extends ValidationRule is created (step 3202). Thisclass should have a suffix of Rule to distinguish it as a ValidationRuleclass. The edit( ) method is overridden (step 3204). The edit( ) methodtakes a user-inputted string and generates a formatted output fordisplay. The normalize( )method takes a user-inputted or formattedstring and generates a normalized output for transmitting to somepersistent storage (step 3206). If the normalize and edit methods havethe same implementation, then implement in the edit() method and havethe normalize( ) method call the edit( ) method. The ValidationRule willcompare user input against the selected business rule (step 3208). Ifthe user input is not valid, then a ValidationRuleException is thrown(step 3210) and the process terminates thereafter. If the user input isvalid, the process also terminates.

C. Create a ViewEvent

With reference now to FIG. 33, a flowchart of a process for creating aViewEvent is depicted in accordance with a preferred embodiment of thepresent invention. In response to AWTEvents, ViewControllers visuallymanipulate components, containers and beans. A ViewEvent is created foran AWTEvent from a ViewController that needs action to be taken beyondthe normal visual manipulation capabilities of the ViewController.ViewEvents are created by ViewControllers and processed byApplicationMediators which are ViewListeners. Other ViewListeners canlisten for ViewEvents to monitor and debug. The details are in twochoices: 1) an interface is created to contain all the various ViewEventcodes used in the application (step 3300), 2) MyViewEvent is a subclassViewEvent and contains the ViewEvent codes. Create an instance ofViewEvent using one of the above codes (step 3302). Data can also besent with the event and send the ViewEvent using fireViewEvent method ofViewControllerImpl (step 3304) with the process terminating thereafter.

D. Create an ApplicationMediator

An ApplicationMediator class is typically present for every applicationfunction or use case of the system to be developed. AnApplicationMediator creates one or more ViewControllers to complete itsfunction. It may also create other ApplicationMediators for nestedfunctions or use cases. With reference now to FIG. 34, a flowchart of aprocess to create an ApplicationMediator is depicted in accordance witha preferred embodiment of the present invention. A particular functionis selected (step 3400) and create a class that extendsApplicationMediatorImpl (step 3402). This class should have a suffix ofAM to distinguish it as an ApplicationMediator class. The init( ) methodis overridden (step 3404). The ViewControllers used by thisApplicationMediator are created (step 3406). The initViewControllers( )and initApplicationMediators( ) methods can be used to create instancesof the classes given a list of class name strings. These init methodsalso add the current ApplicationMediator as the ViewListener for thenewly created instances. The processViewEvent( ) method is overridden(step 3408).

ViewEvents from all ViewControllers and ApplicationMediators created bythe current ApplicationMediator are processed in this method. Thismethod is called in a separate thread from the AWTEvent thread by theviewEventPerformed( ) method of ApplicationMediatorImpl, so that userprocessing can continue. RequestEvents are created for any requests fordata or transaction to be processed by business logic outside of theclient application (step 3410). These requests can be synchronous orasynchronous. For asynchronous RequestEvents, the requestResponse( ) andrequestException( ) methods must be overridden. Refresh( ) is invoked onthe ViewController or ApplicationMediator based on the response of theRequestEvent (step 3412) with the process terminating thereafter. Otherpossible actions based on ViewEvents include, for example, passingcontrol to other ViewControllers or ApplicationMediators. Also, theViewEvent can even be sent to higher level listeners using thefireViewEvent method of ApplicationMediatorImpl.

E. Create a RequestEvent

RequestEvents contain a major code to determine the Destination of therequest and a minor code to determine the type of request. Turning nowto FIG. 35, a flowchart of a process for creating a RequestEvent isdepicted in accordance with a preferred embodiment of the presentinvention.

An interface for containing the strings of major and minor codes ofRequestEvents is created (step 3500). Major codes determine theDestination but should be based on a grouping of related request types.In this manner, the processing of these requests can be changed as agroup. When processing a ViewEvent in an ApplicationMediator, aRequestEvent can be created for requesting data or a transaction from abusiness logic subsystem that may be outside of the client application.An instance of RequestEvent is created using the appropriate major andminor code (step 3502). The event is sent using fireRequestEvent methodof ApplicationMediatorImpl (step 3504) with the process terminatingthereafter.

F. Create a Destination

A Destination takes a RequestEvent and sends it to the appropriatelocation for processing including servers, the hosting clientenvironment, an in memory algorithm, or local devices. Each major codecan be mapped to a different Destination. This allows the clientapplication to access multiple servers and change locations of serverprocessing without requiring code changes in the client application.

With reference now to FIG. 36, a flowchart of a process for creating aDestination is depicted in accordance with a preferred embodiment of thepresent invention. A particular Destination for processing clientrequests is selected (step 3600) and a class that extendsDestinationImpl is created step (3602). In the depicted examples, thisclass has a suffix of Destination to distinguish it as a Destinationclass. The init( ) method is overridden (step 3604). Any initializationrequired to connect to a particular Destination can be implemented inthis method. The requestEventPerformed( ) method is overridden (step3606). A RequestEvent is passed to this method. The method should sendthe request to the appropriate Destination and update the RequestEventwith the response. Use the setStatus method of RequestEvent to updatethe processing status of the request. If a timeout value has been set,then implement a timeout mechanism for processing the request.

The Destination should observe the RequestEvent consume variable as anindicator that processing should be canceled. Next, the finalize( )method is overridden (step 3610) with the process terminatingthereafter. If connection to a Destination needs to be cleaned up, thatfunctionality should be located in this method. The TopListener or anyother class that starts the application should create Destinations andregister them with the Transporter based on the major codes of theRequestEvents the Destination handles.

G. Create a TopListener

A TopListener manages the overall application. The TopListener is theentry point into the hosting client desktop environment, which includesthe operating sytem, a browser, and legacy programs. Typically the classthat contains the top frame of the application will also implement theTopListener interface. This class should have a suffix of Top todistinguish it as a TopListener class.

With reference now to FIG. 37, a flowchart of a process for creating aTopListener is depicted in accordance with a preferred embodiment of thepresent invention. A class is created that contains or is the top frameof the application and implements the TopListener interface (step 3700).An exit( ) method is created (step 3702) and a launch( ) method iscreated (step 3704). Next, a message( ) method is created (step 3706)and a title( ) method is created (step 3708). A TopEvent is created andsent to the TopListener with the fireTopEvent method. A major code ofTopEvent.EXIT indicates that the ApplicationMediator is finished. Amajor code of TopEvent.LAUNCH indicates that the ApplicationMediatorneeds an operating system program to be invoked. A major code ofTopEvent.MESSAGE indicates that the ApplicationMediator needs a desktopspecific message to be displayed. A major code of TopEvent.TITLEindicates that the ApplicationMediator needs a desktop specificapplication title to be displayed.

H. Create a PlacementListener

A PlacementListener is used to place an actual component, container orbean (i.e. ViewController.getComponent( )) on a frame or window. Withreference now to FIG. 38, a flowchart of a process for creating aPlacementListener is depicted in accordance with a preferred embodimentof the present invention. A single type of placement is selected (step3800) and creates a class that implements the PlacementListenerinterface (step 3802). This class should have a suffix of Placement todistinguish it as a PlacementListener class.

The placementEventPerformed method is then implemented (step 3804) withthe process terminating thereafter. An ApplicationMediator and a JavaComponent is passed in to the method. The component should be added tosome container managed by the PlacementListener class.

I. Assembling the JTC Program

The JTC pattern for building most client applications is now given. Thisdescription is the JTC pattern. A Destination “D” object is created andinitialized. A Transporter object “T” is created and initialized. Amajor code “MC” is defined. “D” is added to “T” as a DestinationListenerusing major code “mc”.

A main program “P” that implements the JTC, PlacementListner andTopListener interfaces is created and it creates top level frames.

An ApplicationMediator “AM” object is created. Transporter “T” is addedas a RequestListener. Main program “P” is added as a PlacementListenerand a TopListener. ApplicationMediator “AM” is initialized.ApplicationMediator “AM” creates and initializes one or moreViewControllers “VC” and immediately fires a PlacementEvent to start theprogram visuals.

This is the Java code for the JTC pattern:

-   -   public class MyProgram implements JTC, PlacementListener,        TopListener {    -   public static void main (String[]) {        -   MyProgram P=new MyProgram( );        -   P.createFrames( );        -   MyDestination D=new MyDestination( );        -   dest.init( );        -   MyTransporter T=new MyTransporter( );        -   trans.init( );        -   String MC=“mc”;        -   T.addDestinationListener(MC, D);        -   MyApplicationMediator AM=new MyApplicationMediator( );        -   AM.addPlacementListener(P);        -   AM.addTopListener(P);        -   AM.addRequestListener(T);        -   AM.init( );        -   }    -   }        VI. Subsystem Behavior

A. ViewController Subsystem Runtime Behavior

With reference now to FIG. 39, a diagram illustrating runtime behaviorof a ViewController subsystem is depicted in accordance with a preferredembodiment of the present invention. The runtime behavior of theViewController subsystem 3900 is shown in FIG. 39. This subsystem is thebasic GUI building block and the primary mechanism for interacting withthe user. The ViewController interface 3902 extends JTC interface 3904.It defines the graphic components of an application and specifiesmethods for managing ViewListeners 3906, permissions, properties,resources, visibility and validity. It also specifies methods to refreshdata. The ViewController is also responsible for handling refresh calls3908 and updating the GUI accordingly.

ViewController 3902 is responsible for communication of information toViewListeners 3906. ViewController 3902 knows the full semantics of thedata model. One communication technique for sending information toViewListeners 3906 is to fire a ViewEvent 3910 that the listeners caninterpret. The specification of the major and minor codes in ViewEvent3910 directs the listeners as to what action to perform. Additionalinformation in the form of a String or user-defined data object can bespecified by the setData method. ViewController 3902 also can providenamed methods. Once a ViewEvent 3910 is consumed, it is not forwarded toother listeners. Another communications technique is to use propertychange events on the data model. Management of data and use of thisapproach is discussed explicitly in a later section.

The actual implementation of ViewController interface 3902 is performedin the ViewControllerImpl class 3912. A ViewControllerImpl creates apanel 3914 that allows interaction with the user. All AWTEvents 3916 aresent to a user-defined subclass 3918, which extends theViewControllerImpl 3912. Java provides two built-in mechanisms formanaging panels: the Panel class 3920 that is part of the Java AWT andthe Jpanel class 3922 that is part of the com.sun.java.swing package.ViewControllerBaseImpl 3924 is a superclass of ViewControllerImpl 3912,which abstracts these different panel mechanisms.

ViewController subsystem 3900 is also responsible for validating dataformats. ValidationRules 3926 themselves are not part of theViewController 3902, but the ViewController 3902 performs thisvalidation between the input and output using the standard AWT methodssuch as getText and setText. The edit method inputs a transmittablestring and outputs it in visible form (e.g., 1234 to $12.34) while thenormalize method inputs a string in visible form and converts it totransmittable form (e.g., $12.34 to 1234). A failure in formatconversion results in a ValidationRuleException 3928.

For instance, data starts out in a text field (component) in aViewController (component) that derives from JPanel (container). Thevalue of the text field is retrieved and passed as a String to thevalidation rule. The result will be a validated and formatted string oran exception. In the former case, the textfield is redisplayed with thenew contents AND/OR the data model is updated. In the latter case, someerror message is displayed.

With chaining, the results of each validation rule call are passed tothe next validation rule. Processing will stop when the first exceptionis encountered (first exception first return (FEFR)) or all validationrules have been processed.

Turning next to FIG. 40, steps in the operation of a ViewControllersubsystem, as viewed from a ViewControllerImpl, are depicted inaccordance with a preferred embodiment of the present invention. Theprocess begins by implementing the ViewController interface (step 4000).Thereafter, the JTC interface is implemented (step 4002). Thereafter,specific methods are added for the ViewController (step 4004).Thereafter, the GUI is created and composed (step 4006). Thereafter, areference to “yourself” is returned in getComponent (step 4008).ViewControllerBaseImpl or any subclass of ViewControllerImpl can returnthe particular component to be placed (by the PlacementListener) in thegetComponent( ) method) Thereafter, permission keys, resources, andproperties are returned when requested (step 4010).

The permission keys, resources, and properties are updated whenrequested (step 4012). Internal AWTEvents are handled (step 4014). Datafields are validated and formatted (step 4016). ViewEvents are issuedfor semantic interpretation (step 4018). The AWT thread is returned(step 4020). Refresh calls are handled to update the GUI (step 4022).Data is accessed (step 4024). A determination is made as to whether theViewController is still active (step 4026). If the ViewController isstill active, the process returns to step 4010. Otherwise, the processterminates for the ViewControllerImpl.

Additionally, a ViewController may be used to generate alternate views.For example, the application containing the view controller may belocated on the server in which a placement listener is used to call amethod in the ViewController to generate a presentation of a componentin an alternate format, for example to be displayed in an HTML browseror an XML browser. In this example, the ViewController is on the serverwhile the alternate view is displayed on the client. ThePlacementListener has one method: placementEventPerformed that takes aPlacementEvent as a parameter. The PlacementEvent contains a major,minor, source ApplicationMediator and Component (from getComponent( ) ofthe ViewController). To use the alternate view, and without extendingthe PlacementEvent definition, it should be noted that to call for thealternate view, the ViewController needs to be accessed. Therefore, theViewController can be accessed via the Object data; variable in thePlacementEvent.

Alternate views, may include, for example, text for text based terminalsor event data for a debug monitoring display, also, any user input fromHTML or other view comes back to ApplicationMediators andViewControllers as refresh data. The ApplicationMediator may eitherdisplay the next ViewController or have current ViewController redisplaythe entered user input.

With reference now to FIG. 41, a flowchart of an alternate view processis depicted in accordance with a preferred embodiment of the presentinvention. The processes of the present invention may be applied toother types of applications other than clients. For example, the processof the present invention may be applied to create applications for useon a server. In FIG. 41, the process of the present invention is used togenerate an alternate view in which the containers are output in theform of HTML for transfer to a client over a communications link.

In FIG. 41, the application mediator receives a ViewEvent from aViewController (step 4100). A determination is made as to whether theViewController should be placed in the client (step 4102). If theViewController should not be placed, then the process terminates. If theViewController should be placed, then a PlacementEvent is created withthe proper major code (step 4104). This PlacementEvent is then fired(step 4106). A PlacementListener is invoked (step 4108). ThePlacementListener receives the PlacementEvent(step 4110). Adetermination is made as to whether the major code is for a placementHTML (step 4112). If the major code is for an HTML placement then a callis made by the PlacementListener to toHTML method in the ViewController.(step 4114). In response, the view components are translated into HTMLcomponents (step 4116). An HTML output is generated (step 4118). ThisHTML output is then sent to the client browser for display (step 4120)with the process then terminating.

With reference again to step 4112, if the major code does not indicatethe use of HTML as an alternate view, then a determination is made as towhether the major code identifies another alternate view (step 4122). Ifanother alternate view is not indicated by the major code, then theprocess terminates. Otherwise, an alternate view is created and placed(step 4124) with the process then terminating. The other alternate viewmay take various forms, such as, for example, XML. Step 4122 may beiterated for a number of different alternate views that may be providedthrough the ViewController component. In this manner, the architecturalpattern of the present invention may be applied for use on a server.This mechanism is used by a PlacementListener to call a method in aViewController to create an HTML version of an existing screen. Themechanism for creating the HTML view is application dependent/screendependent in the depicted examples.

An example of how to configure JTC with alternate views on a server isgiven. The deployment of JTC on the server is under the control of aservlet. Since, as described in this example, HTML is in the client,when a client browser invokes a URL submit, the web server obtains therequest and passed control to a servlet. The servlet obtains a key/valuepair list of values entered in the HTML client. This list is passed tothe ViewController alternate view being displayed. The ViewControlleriterates over the list and applies its ValidationRules. If aValidationRuleException is generated, the servlet indicates an errormessage to the HTML client. If a successful result is obtained, theViewController will generate a ViewEvent, as mentioned above, causingthe alternate view cycle through the ApplicationMediator andPlacementListener to repeat. The primary benefit being that one sourcecode system can be maintained and versioned to produce multiple clientchannel views.

Turning now to FIGS. 42 and 43, diagrams detailing processes within theViewController subsystem are depicted in accordance with a preferredembodiment of the present invention. The code illustrated is Java codein the depicted examples.

The creation of a ViewEvent based on an ActionEvent from the Java AWT isshown in FIG. 42. The actionPerformed method detects the type of actionand constructs a corresponding ViewEvent. The source of the ActionEventwas a click of the nextButton. This is detected and the ViewEvent ve iscreated with the self-referential “this” pointer being passed in. Themajor field is set to NEXT, a predefined type, and the event is fired.ActionPerformed has done its job and returns.

FIG. 43 shows how a ViewEvent is processed by a Before any events can beprocessed, an object has to add itself as a listener for the appropriateViewEvents. In this case, the listener is added to thecustomerDetailsViewController. The method processViewEvent may carry outsome initial action for all events and then a switch statement is usedto separate out all of the major code fields of interest. The commentsinside the switch indicate where different actions can be performed fordifferent events. A complete list of predefined major event codes isgiven in FIG. 44.

Validation rules either use edit to convert from a transmittable stringto the viewable format or use normalize to convert from a viewableformat to a transmittable string. FIG. 44 shows how a text fieldrepresenting a social security number can be put into visual form (e.g.,123-45-6789) by calling SocialSecurity.edit. Since aValidationRuleException will be thrown if the conversion isunsuccessful, this call is embedded in a try statement with a catch forexception handling. In a comparable manner, FIG. 46 shows how the visualformat for a social security number can be converted back to atransmittable format.

It is possible to build a chain of validation rules. FIG. 47 illustratesthe application of two edit rules, range checking (that is, the value iswithin specific limits) and formatting for viewing. The separate rulesare assigned to string values named range and money. This string valuesare then put into an array of strings. The transmittable form of thedata is stored in value. The method applyEdits applies both validationrules to this data; if any exception occurs, it is handled by the catchportion of the try statement. The setText method from the Java AWT isused to redisplay the formatted data.

Two techniques exist for creating the ViewControllerBaseImpl class: byinheritance and by delegation. FIG. 48 illustrates inheritance where theViewControllerBaseImpl is a subclass of JPanel from the Javacom.sun.java.swing package. Notice that the operation getComponentsimply returns a pointer to itself. When delegation is used, as shown inFIG. 49, ViewControllerBaseImpl implements the ViewController interface.The constructor for a user defined XYZ class creates a new instance,called xyz. Operations from the ViewControllerBaseImpl class aretranslated into corresponding operations from the XYZ class. Threeoperations are illustrated: getComponent, setEnabled, and setVisible.

B. ApplicationMediator Subsystem Runtime Behavior

Turning now to FIG. 50, a diagram illustrating runtime behavior of anApplicationMediator subsystem is depicted in accordance with a preferredembodiment of the present invention. The runtime behavior of theApplicationMediator subsystem 5000 is shown in FIG. 50.ApplicationMediator 5002 manages all the major components of the thinclient architecture JTC 5004. This includes managing instances ofViewControllers 5006 and ApplicationMediators 5008, and adding, firing,or removing instances of PlacementListeners 5010 and TopListeners 5012.The implementation of the interface of ApplicationMediator 5002 iscarried out by the class ApplicationMediatorImpl 5014. An applicationdependent subclass 5016 of ApplicationMediatorImpl 5014 actuallyprocesses the various events in the subsystem 5000. ApplicationMediatorsubsystem 5000 can process ViewEvents 5018 generated by ViewController5020 and it can generate its own ViewEvents if necessary. Requests foractions to be performed by the server result in RequestEvents 5022.

A subclass is needed to implement a state machine for correctly orderingoperations. Sample operations include which ViewControllers 5006 toallocate or which to make visible, when to fire or re-fire a ViewEvent,when to fire a RequestEvent 5022, and when to fire a TopEvent 5012.

The typical sequence of actions when a ViewEvent is received is torequest a PlacementListener 5010 to place another ViewController 5006 onthe screen, to request TopListener 5012 to do something with theoperating system desktop, and to fire RequestEvents 5022 for fulfillmentby a server. Refresh calls are propagated to the ViewControllers 5006and ApplicationMediators 5008. All JTC objects allocated are returnedvia the getJTCs method.

Turning next to FIG. 51, a diagram illustrating Event threading supportis depicted in accordance with a preferred embodiment of the presentinvention. FIG. 51 illustrates the two styles of AWT Event threadingsupport. This occurs when a ViewController 5100 generates a ViewEvent5102 that is to be processed by the ApplicationMediator 5104. Style 1uses a queuing mechanism while style 2, the default, uses threaddispatching.

The following steps occur when using the queuing approach: create asleeping thread during initialization, when a ViewEvent arrives place itin a queue 5106 of ViewEvents, notify the sleeping thread and return tothe calling ViewEvent thread (typically an AWT Event thread). The run( )method 5108 wakes up to process the ViewEvent by taking it off thequeue. The processViewEvent method is then called. Subclasses overridethis method to handle the ViewEvent directly.

The second mechanism is to use thread dispatching directly. When aViewEvent arrives, create and start a thread 5110 passing it theViewEvent and return to the calling ViewEvent thread. Add the new threadto a list to provide a handle to access it. This new thread invokes theprocessViewEvent method which subclasses can override to handle theViewEvent directly.

With reference now to FIG. 52, a flowchart of a process used indesigning and executing an ApplicationMediator is depicted in accordancewith a preferred embodiment of the present invention. The process beginsby implementing an ApplicationMediator interface (step 5200).Thereafter, the JTC interface is implemented (step 5202).ApplicationMediatorImpl methods are added (step 5204). ViewControllersare created using the initViewController method (step 5206).

Thereafter, initApplicationMediator are used to create otherApplicationMediators as necessary (step 5208). Thereafter, the processlistens for ViewEvents and RequestEvents (step 5210). A determination ismade as to whether a ViewEvent has been received (step 5212). If aViewEvent has not been received, the process returns to step 5210.Otherwise, a request is made to a PlacementListener to put anotherViewController on the screen (step 5214). This step basically results inthe display of another ViewController's getComponent( ) on the screen.

Next, the TopListener performs desktop operations as appropriate (step5216). The ApplicationMediator also fires the appropriate RequestEventto server (step 5218). Refresh calls are sent to ViewControllers andApplicationMediators (step 5220). All JTC objects allocated are returned(step 5222) with the process then returning to step 5210.

C. Placement Subsystem Runtime Behavior

With reference now to FIG. 53, a diagram illustrating runtime behaviorof the Placement subsystem is depicted in accordance with a preferredembodiment of the present invention. The runtime behavior of thePlacement subsystem is 5300 shown in FIG. 53. The JTC architectureseparates out the actions of ViewEvent 5302 creation (done byViewController, 5304), view ordering (done by ApplicationMediator,5306), and view placement (done by PlacementListener, 5308). APlacementEvent 5310 is used to notify a PlacementListener that aViewController needs to be adjusted on the screen.

The state of a PlacementEvent includes a major code, which is theprimary identifier of the PlacementEvent. A minor code serves as thesecondary identifier of the PlacementEvent. The PlacementEvent statealso includes a source identifying the source object that creates theEvent. A java.awt.Component also is present in the state that identifiesthe component to be placed. The state also contains consume, whichidentifies whether an PlacementEvent has been consumed. A consumedPlacementEvent will cause the JTC to stop processing the PlacementEventimmediately. Additionally, the PlacementEvent state also may containother data, which may be, for example, a reference to generic objectdata that specifies placement information specific to the application.

Each PlacementEvent 5310 contains a placement type (ADD, ADDALL, REMOVE,REMOVEALL, MODIFY, SHOW, DONE, FREEZE, and REPAINT are predefined), aminor code for additional information, the sender of the event, thecomponent, and provisions for additional generic data. Typically anApplicationMediator 5306 will assign the appropriate major code, findthe component using the getComponent method, create PlacementEvent 5310making itself the sender, and fire the placement event. ThePlacementListener 5308 uses placementEventPerformed to processPlacementEvent 5310 based on the placement type and the source of theevent.

Details of the steps discussed above are now examined through variousexamples of Java code. The creation of a PlacementEvent from anApplicationMediator is shown in FIG. 54. There are three parameters to aPlacementEvent constructor: the object (referenced by “this”) creatingthe event, the component involved, and the major code. In this example,the major code is set to ADD and the component comes fromcustomerDetailsViewController. After the PlacementEvent is created, itis fired by the ApplicationMediator.

The PlacementEvent is processed by a PlacementListener, as shown in FIG.55. The method placementEventPerformed decides on the appropriate actionbased on the major code and the source. In this example, the major codeis ADD, which is one of the cases in a switch statement. If the sourceis PreferencesAM, then the PlacementEvent component is centered inpanel1, otherwise it is added to panel2.

Turning now to FIG. 56, a flowchart of a process used in processing aPlacementEvent is depicted in accordance with a preferred embodiment ofthe present invention. The process begins by one or more ViewControllersresponding to getComponent (step 5600). After, ApplicationMediatorscontrol the ordering of the ViewController (step 5602). TheApplicationMediators fire PlacementEvents (step 5604). ThePlacementListeners select the proper implementation and place theComponent on the screen (step 5606) with the process terminatingthereafter.

D. TopListener Runtime Behavior

With reference now to FIG. 57, a diagram illustrating runtime behaviorfor a TopListener subsystem is depicted in accordance with a preferredembodiment of the present invention. The runtime behavior of theTopListener subsystem 5700 is shown in FIG. 57. TopListener 5702performs generic operations on the business desktop, as specified by aTopEvent 5704. The TopEvent and TopListener have several functions. Onefunction is interaction with the host environment (i.e. for a Javaapplication—the operating system), with the host environment services(i.e. other applications on the operating sytem), with the applicationenabler (i.e. the Netscape browser and its status line or maybe aspectsof the Java Virtual Machine), and with host environment policies (i.e.how is shutdown handled, how are error messages handled). The hostingclient desktop environment is an embodiment of one or more of theseitems.

The TopListener is also used by the JTC application to send events toitself. For example, based on some heuristic, the TopListener may decideto change the Destination from one using sockets to one using URLs. Or,a second destination may be added to perform logging. The permissionsalso may be altered. The TopListener may use a heuristic to decide toinvoke hookJTCs and hookAWTs on the application and start tracing. Thus,in addition to accessing hosting services, the TopListener also allowsself alterable JTC actions to occur on the JTC application.

TopEvent 5704 contains a major code, a minor code, the source thatcreated the event, a consumed event that causes the JTC to stopprocessing it as soon as possible, and a generic data object. There arepredefined constants for EXIT, BROWSER, TITLE, STATUS, OS, TRACE, DEBUG,LOG, HOOKAWT, and HOOKJTC. ApplicationMediator 5706 uses addTopListenerto pass itself to the TopListener for later callback in thetopEventPerformed method.

Details of the steps discussed above are now examined through variousexamples of Java code. With reference now to FIGS. 58-60, Java.code usedin a TopListener is depicted in accordance with a preferred embodimentof the present invention. The creation of an ApplicationMediator and theadding of a PlacementListener is shown in FIG. 58. The creation andfiring of a TopEvent in an ApplicationMediator is shown in FIG. 59. Javacode illustrating the callback to a TopListener with a TopEvent andinspecting the TopEvent for semantic interpretation is shown in FIG. 60.This method uses the major code to separate out the various cases and toperform the appropriate actions.

E. RequestEvent Subsystem Runtime Behavior

The RequestEvent subsystem provides a mechanism for sending messagesbetween various components in the architectural pattern of the presentinvention. This subsystem provides a mechanism to access data and tosend data between components, such as an ApplicationMediator, aTransporter, and a Destination. With reference now to FIG. 61, a diagramillustrating runtime behavior of a RequestEvent subsystem is depicted inaccordance with a preferred embodiment of the present invention. Theruntime behavior of the RequestEvent subsystem 6100 is shown in FIG. 61.An ApplicationMediator 6102 receives a ViewEvent 6104 from aViewController 6106 and determines it has to issue a RequestEvent 6108to an appropriate service provider. RequestEvent 6108 can either besynchronous or asynchronous in the depicted examples. RequestEvent 6108has fields for a major code (a request family), a minor code (a specificrequest), a user-defined version, a status string showing the currentstage of processing, a possible consume event that will cause the JTCapplication to stop processing it as soon as possible, and a data fieldfor a generic data object.

ApplicationMediator 6102 calls fireRequestEvent. A Transporter, which isone example of a RequestListener 6110, is responsible for forwarding allRequestEvents to one or more destinations based on the major code.ApplicationMediator 6102 will be called back in one of two ways:requestResponse to indicate success and passed a RequestEvent that mayhave new data or requestException to indicate failure and passed aRequestException with the reason for failure.

With reference now to FIG. 62, Java code illustrating the creation ofRequestEvent, setting its major and minor codes, and firing anasynchronous RequestEvent from an ApplicationMediator is depicted inaccordance with a preferred embodiment of the present invention. Detailsof the steps discussed above are now examined through various examplesof Java code.

The creation, firing, and callback of a RequestEvent in anApplicationMediator is shown in FIG. 62. After the RequestEvent r iscreated, the major and minor codes are set to “Loans” and“SubmitCustomerInfo” in this example. The event r is firedasynchronously by the ApplicationMediator. This is done inside of a trystatement so that any RequestException can be caught and processedappropriately in FIG. 63. Later there will be a callback to theApplicationMediator by requestResponse to indicate successful processingof the RequestEvent or by requestException to indicate failureprocessing the RequestEvent in FIG. 64.

With reference now to FIG. 65, a flowchart of a process for using aRequestEvent is depicted in accordance with a preferred embodiment ofthe present invention. The process begins by an ApplicationMediatorreceiving a ViewEvent from a ViewController (step 6500). Thereafter, theApplicationMediator creates a RequestEvent specifying the major code,and a version (step 6502). Thereafter, a fireRequestEvent is issued tocause the RequestEvent to be sent to a service provider (step 6504).Based on the major code, the Transporter forwards the RequestEvent toone or more Destinations (step 6506) with the process terminatingthereafter.

F. Transporter Subsystem Runtime Behavior

The Transporter subsystem is used to map and send various RequestEventsto different Destinations. With reference now to FIG. 66, a diagramillustrating runtime behavior of a Transporter subsystem is depicted inaccordance with a preferred embodiment of the present invention. Theruntime behavior of the Transporter subsystem 6600 is shown in FIG. 66.The main task of the Transporter class 6602 is to map RequestEvents 6604received from an ApplicationMediator 6606 to the appropriateDestinations. A Destination 6608 is added to the Transporter 6602 byusing addDestinationListener. Each listener is associated with adestination major code. In the depicted examples, multiple destinationscan listen for the same major code. Events are processed in a First-InFirst-Out, First Exception First Return (FIFO/FEFR) 6610 fashion inthese examples. It is possible to have one Destination pass a message toanother Destination. RequestExceptions 6612 are used to handle failures.

Turning now to FIG. 67, Java code illustrating creation of a Transporterand adding it as a RequestListener is depicted in accordance with apreferred embodiment of the present invention. The Transporter t andApplicationMediator am are both created. The method addRequestListeneris called to add t as the transporter for am.

G. Destination Subsystem Runtime Behavior

A Destination subsystem provides a number of different functions, suchas, for example, locating a server, creating low level protocols, suchas sockets, URLs, RMI, and files for network transport. Additionally,the Destination subsystem provides a mechanism to communicate withdifferent servers, such as EJB, servlets, web servers, applicationservers, and other legacy systems. Additionally, message formats areprovided to turn RequestEvents and data into formats for the target orserver. Additionally, the Destination subsystem will finish the job inan appropriate amount of time or cancel the operation in response to atimeout. Additionally, the Destination subsystem also determines howmany times a connection should be retried. Additionally, the Destinationsubsystem caches data until it becomes stale. Additionally, theDestination creates all data model objects used in the JTC clientapplication. Pre-processed and post-processed RequestEvents are alsologged along with locating and creating objects for processing requests.

With reference now to FIG. 68, runtime behavior of a Destinationsubsystem is shown in accordance with a preferred embodiment of thepresent invention. In Destination subsystem 6800, Destination class 6802and its implementation, DestinationImpl 6804, handles all the details tolocate server 6806, use various transport types and server types 6808,and, in general, keeps track of where objects are. Destination codes areeither named, given a wildcard value (*, means interested in allrequests) or given a priority value (!, means interested in all requestsand has priority). Some special cases of priority are FIRST, SECOND, . .. , NINTH. DON'T_CARE is a special case of wildcard that indicates evenif a RequestException is present, do not stop processing and send therequest to the Destination.

Details of the steps discussed above are now examined through a Javacode example. In FIG. 69, a diagram of Java code for creation of aDestination and adding it as a destination listener is depicted. Turningnow to FIG. 69, Java code illustrating creation of a Transporter andadding it as a RequestListener is depicted in accordance with apreferred embodiment of the present invention. The Destination d and theTransporter t are both created. The method addDestinationListener iscalled to add d as a destination listener for transporter t using themajor code “Loans.”

Turning next to FIG. 70, a diagram illustrating Java code for creatingDestinations with wild card, priority and normal major codes, firing aRequestEvent, and a report of the expected results is depicted inaccordance with a preferred embodiment of the present invention.Transporter t and WildDestination d are created and d is added as aWILDCARD destination listener. Destination d is now assigned to be aEJBDestination and added to t with the major code of “Loans.”Destination d is then assigned to be a PriorityDestination and added tot with the major code of PRIORITY. Finally d is assigned to be aLoggerDestination and added to t with the major code of DON_CARE. At alater time, the RequestEvent r is created with the major field of“Loans” and is fired. Event r will be sent to PriorityDestination1^(st), EJBDestination 2^(nd), WildDestination 3^(rd), andLoggerDestination last. Event r reaches the first three destinationsonly if no RequestExceptions are thrown; it reaches LoggerDestinationregardless of any RequestExceptions.

VII. Component Details and Applications

A. Use of getJTCs

The architectural pattern of the present invention as all major objectsin a JTC application implement the JTC interface. This includes thedriver programs that launches the Application or applet. This interfaceallows referencing of all objects with a consistent Java type. Thebehavior includes, clear, exit, getJTCs, init, isEnabled, setEnabled,and toString. Interfaces extending JTC are ViewController,ApplicationMediator, and Destination. ViewControllerImpl,ApplicationMediatorImpl, Transporter, and DestinationImpl are classesimplementing JTC. Consider a program called “program” that implementsall of “significant” the Java and user defined interfaces. A significantinterface is an interface in which the “program” is interested inreceiving callbacks. The method causes each JTC object to return a listof other JTC objects that the JTC object creates. This method may beused by the “program” to iterate over this list and inspect eachobject's types and add the “program” as a listener to all of theobject's significant event listener types. As a result, the system maybe reconfigured through this mechanism. For example, the Transporter maybe disabled or a priority Destination may be added using this method.Further, this method provides a mechanism for non-intrusive logging,tracing, debugging, and monitoring. This is particularly significantwhen a ViewController is encountered. In addition to adding the“program” as a ViewListener, the getComponent method is called toretrieve a java.awt.Component. The java.awt.Component object is at thetop of the Java graphics Component hierarchy. The “program” recursivelylooks at this hiearchy, traverses it, and add the “program” as listenersfor all significant Java AWTEvent and JFC events. Using reflection, anyJava object that is returned can be inspected and “hooked” forsignificant interface events. The “program” can do various tasks withthese events such as trace, remotely display the events, reroute theclient application to a new server, and record user statistics; allnon-intrusive to the application in terms of writing additional code tosupport this capability.

With reference now to FIG. 71, a diagram of Java code used foraccessing, identifying type and recursively attaching JTC, AWT and JFClisteners to processing accessible JTC, AWT and JFC programs and objectsJTCs is depicted in accordance with a preferred embodiment of thepresent invention. In particular, all JTCs are found and put into a JavaVector. Additional actions are performed depending on the type of JTC,such as adding RequestListeners for ApplicationMediators or addingViewlisteners for ViewControllers. This function continues processingall JTC objects in a recursive manner.

The function is named hookJTCs and it starts out at the root JTC. TheVector jtcs is initialized to null. The method getJTCs is used to findall JTCs of the root. If an exception occurs or no JTCs are found, thefunction is exited.

Assuming the vector is not empty, each JTC object in the vector isprocessed in turn. This code illustrates the “program” adding itself asa RequestListener and ViewListener to ApplicationMediators. This codeissustrates the “program” adding itself as a ViewListener toViewControllers Although not shown in the code, other JTC objects, suchas a Transporter, might be hooked by the “program”. The functionhookJTCs is called recursively at this point resulting in the JTChierarchy being processed in a depth-first then breadth-first fashion.

With reference now to FIG. 72, an example of a test program is depictedin accordance with the preferred embodiments of the present invention.In FIG. 71, the main program Test1.java stores a static reference toitself so that a launcher can call getJTCs( ) and hook the application.FIG. 73 is a diagram of Java code used for attaching AWT and JFClisteners to AWT and JFC containers, components and beans depicted inaccordance with a preferred embodiment of the present invention. FIG. 74is a diagram of Java code used for attaching AWT and JFC listeners toAWT and JFC components (java.awt.Button, com.sun.swing.java.JButton andcom. and com.sun.java.swing.JTextField) depicted in accordance with apreferred embodiment of the present invention.

With reference now to FIG. 75, a flowchart of a process for accessingobjects is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by receiving a call to get JTCsand get the vector of JTC object (step 7500). A determination is thenmade as to whether a return is null (step 7502). If the return is null,the process then returns. This indicates that no objects are present.Otherwise, a determination is made as to whether more entries arepresent (step 7504). If more entries are present, then an unprocessedentry is used (step 7506). Thereafter, a determination is made as towhether the entry is an instance of an ApplicationMediator (step 7508).If the instance is that of an ApplicationMediator, the “program” isadded as a ViewListener (step 7510).

The process then adds the “program” as a RequestListener (step 7512)with the process then making a recursive call and starting at step 7500.

With reference again to step 7508, if the entry is not an instance of anApplicationMediator, a determination is made as to whether the instanceis that of a ViewController (step 7514). If the object for the entry isan instance of a ViewController, the “program” is added as aViewListener (Step 7516). Thereafter, a hookAWTs with the componentreturned from the ViewController's getComponent method is performed(step 7518). This step is described in more detail below with respect toFIG. 77. The process then makes a recursive call and starts at step7500.

With reference again to step 7514, if the instance is not aViewController, then a determination is made as to whether the objectfor the entry is an instance of a Transporter (step 7520). If the objectis an instance of a Transporter, the “program” is added as aRequestListener (step 7522) with the process then making a recursivecall and starting at step 7500.

With reference again to step 7520, if the object is not an instance of aTransporter, a determination is made as to whether the object is aninstance of a component (step 7524). If the object is an instance of thecomponent, the process performs hookAWTs with the component (step 7526)with the process then proceeding to step 7504. Step 7526 is used tohookAWTs to a component. With reference again to step 7524; if theobject is not an instance of a component, the process then returns tostep 7506 to select another entry for processing.

With reference again to step 7504, if more entries are not present, thena non-intrusive program, the “program”, is run to listen for events anddebug, log, trace, and/or simulate (step 7528). The debug, log, trace,and/or simulate functions may be performed using presently availabletechniques for debugging, logging, tracing, and/or simulatingapplications.

B. Recursive Processing of a Component Hierarchy

A component hierarchy is a recursive data structure in the sense that,if the component is a container, then it may contain other components,which in turn may contain other components, and so forth. Consider thehierarchy shown in FIG. 76. Component A 7600 is a container that is alist of three other components: A1 7602, A2 7604, and A3 7606. A1 7602is a container with two components A11 7608 and A12 7610), and A3 7606is a container with two components (A31 7612 and A32 7614). Thecomponents A11 7608, A12 7610, A2 7604, A31 7612, and A32 7614 are notcontainers. The goal of a “hook” algorithm is to find all the componentsin the hierarchy and “hook” each “child” component to the “program”component in the sense of adding appropriate listeners for events, whilepassing through the “parent” container.

Since the component hierarchy is a recursive data structure, a recursivealgorithm most easily processes this hierarchy. It starts at the rootcomponent, A BT00, and determines if it is a container. It proceeds toprocess the first component in the container, A1 BT02, using the samealgorithm. A1 7602 is also a container, so the algorithm is appliedrecursively to the component A11 7608. All is not a container, so a“hook” to this component (that is, appropriate listeners) is added.Control now returns to the algorithm processing A1 7602. There isanother component in the list of A1 7602, namely A12 7610, and it isprocessed recursively. A12 7610 is not a container, so it adds listenersappropriate for its type. No more components exist in the list ofcomponents for A1 7602, so it has now added listeners for all itschildren. Control returns back to the algorithm processing parent A.

Component A proceeds to the next item in its container, namely A2 7604.A2 7604 is not a container, so it adds listeners appropriate for itstype. A now has added all the appropriate listeners for its children, A17602 and A2 7604, and all of their descendants. A3 7606 is processednext and, in a manner analogous to A1 7602, it adds listeners for itstwo children, A31 7608 and A32 7614. Listeners have been added for allof the descendants of A 7600, so the algorithm terminates.

With reference now to FIG. 77, a flowchart of a process for performinghookAWTs is depicted in accordance with the preferred embodiment of thepresent invention. This process is used to hookAWTs to a component. Theprocesses depicted in FIG. 77 are a more detailed description of steps7518 and 7526 in FIG. 75. The process begins by determining whether thecomponent is a container (step 7700). If the component is a container;then a list of the components in the container is obtained (step 7702).Thereafter, a determination is made as to whether more components arepresent in the list (step 7704). If more components are present in thelist, then the next component is selected for processing (step 7706). Arecursive call to D is performed (step 7708). This step results in theprocess returning to step 7.700 and performing the steps as describedabove. Thereafter, the process hooks the component (step 7710). Then,the process returns to step 7704 to determine whether more componentsare present in the list.

If more components are not present in the list, then the component ishooked (step 7712) with the process and returns.

With reference again to step 7700, if the component is not a container,then the process also proceeds to step 7712. Step 7710 and step 7712 aredescribed in more detail below in FIG. 78.

With reference now to FIG. 78, a process for hooking a component isdepicted in accordance with the preferred embodiment of the presentinvention. FIG. 78 is a more detailed description of the processesperformed in step 7710 and 7712 in FIG. 77. The process begins bydetermining whether the component is an instance of a button (step7800). If the component is an instance of a button, the button is addedas an action listener (step 7802) (with the process then returning). AnAction Listener listens for events generated by Button, List, MenuItem,and TextField, all objects that can be part of the user interface. Theevent is handled by the method actionPerformed.

With reference again to step 7800, if the component is not an instanceof a button, a determination is made as to whether the component is aninstance of a JButton (step 7804). Button is an object built using theAWT. JButton is an object built using the Swing library. Swingcomponents typically provide greater platform independence. If thecomponent is an instance of a JButton, then the JButton is added asActionListener, a ChangeListener, and an ItemListener (step 7806). AChangeListener listens for events generated by JFC components when theirinternal state has changed. The event is handled by the methodstateChanged.

An ItemListener listens for events generated by Checkbox,CheckboxMenuItem, Choice, and List, all objects that can be part of theuser interface. The event is handled by the method itemStateChanged.

With reference again to step 7804, if the component is not an instanceof a JButton, a determination is made as to whether the component is aninstance of a component (step 7808). If the component is an instance ofa component, then the component is added as an ActionListener and aCareListener (step 7810), with the process returning thereafter. ACaretListener listens for events generated by objects that contain textcursor positions (caret) and the caret changes in the position of text.The event is handled by the caretUpdate method.

With reference again to step 7808, if the component is not an instanceof a component, a determination is made as to whether the component isan instance of other AWT/Swing/Bean types in Java (step 7812). If thecomponent is an instance of these other types, then the component isadded to all event types generated by the component, with the processreturning thereafter. If the component is not an instance of these othertypes, the process then returns.

The getJTCs and getAWTs algorithms are easily extended to other objecttypes and hiearchies by brute force coding of the“instanceof/addListener” tests or by using reflection on the objects to“search for interfaces, search for interface methods, addListener” asreflection supports.

C. Management of Data Objects

User interaction triggers ViewEvents to perform a variety of tasks.These include system tasks (e.g., open, close, cancel, etc.), statustasks (e.g., various messages), navigation tasks (e.g., next, previous,first, last, etc.), data tasks (e.g., add, delete, modify, etc.), assisttasks (e.g., search, find, help, etc.) and live (streaming) tasks (e.g.fast, medium, delay, timer, on, off, high, low, etc.).

Some tasks can be performed locally, but others are sent to a servicefullfillment provider (the Destination) in the form of a RequestEventcontaining appropriate data. Data is returned, often different than thedata sent, and refresh is used to change what the user is viewing.

Details of the steps discussed above are now examined through variousexamples of Java code. With reference now to FIGS. 79-82, diagrams ofJava code for use in managing data objects is depicted in accordancewith a preferred embodiment of the present invention. Passing data forthe main program to ApplicationMediators is shown in FIG. 79. TheApplicationMediator.am1 and the data object named data are created. Byusing the refresh method, the main program passed this data into theApplicationMediator. Refresh accepts any data object regardless of thenumber or shape of objects. It is because the data type definition is“Object data;” that JTC data support is neutral to the actual classesand interfaces of the data models being used. It is because the refreshmethod uses a data type definition “Object data;” that additional datamodels can readily be integrated into a JTC client application withminimal effort and side effects. The ApplicationMediatorImpl passes therefresh on to all ApplicationMediators and ViewControllers.

Alternatively, if the results of a RequestEvent contains changed data,the ApplicationMediator can initiate the refresh on to allApplicationMediators and ViewControllers.

The code in FIG. 80 illustrates how a ViewController would handle datathat uses the an example key-value pair data model. The first refreshfunction simply receives the data as type Object and type casts it totype KeyValue in a call to the worker refresh function of the key-valuedata model. The refresh of key-value pairs calls the AWT method setTextfor each of the textfields and then calls repaint( ) to change the userdisplay (validate( ) followed by repaint( ) can also be used). The codein FIG. 81 illustrates how this top level refresh method can input anyobject and route it to a more particular version of refresh by detectingthe type of data and casting it to a more specific type. The typesVector, KeyValue, and XMLData are shown, but others can be added. FIG.82 illustrates the processing of data in the form of a Vector where thefirst element is of type Customer and the second element is the ID.These two values are extracted from the vector, cast and then assignedto the appropriate fields by using setText. A repaint updates thescreen.

Although the Destination locates, creates and packages these data types,the ViewController also knows the syntax of the data layout andpackaging and the semantics of the data model.

ApplicationMediators and ViewControllers can also bypass the normal JTCViewEvent notifications when data has changed. For example, refresh canuse an implicit data model (i.e. String, Integer), a user defined datamodel (described above), named methods in the ViewController (lessportable) and traditional Java property change event notifications.Further, live data models (i.e. streaming media, asynchronous deviceinput) can also be incorporated easily. It is because JTC uses the datatype “Object data;” and because the refresh method uses a data typedefinition “Object data;” that additional data models, eventnotifications, data access and data update differences can readily beintegrated into a JTC client application with minimal effort and sideeffects—the GUI parts of the ViewController, ValidationRules,ApplicationMediators, ViewEvents, RequestEvents, TopEvents,PlacementEvents, TopListeners, and PlacementListeners do not have tochange. Only small parts of the ViewController and Destinations needmodification. This variety of techniques is illustrated next in FIG. 83.

One way for the ViewController 8300 to change data 8302 is implicitlythrough the ApplicationMediator 8304. The ApplicationMediator will havea named method to get the appropriate field, such as CustomerName asshown. The setData method is called for a ViewEvent 8306 and theViewEvent is fired. The ApplicationMediator 8304 changes the datathrough a property change. The other alternative is to change the dataexplicitly through the ViewController 8300. A put operation on theappropriate field is attached to an instance of the data. This is sentto the data via a ViewEvent. The operation data.put is a property changeevent.

In general, the developer should keep the data “thin.” This means thenumber of classes to represent data should be kept small and the sizeshould be kept small to facilitate network transfer. For someapplications, it is appropriate to use lists for “drill down” or cacheddata to facilitate disconnected mode.

D. TopListener

With reference now to FIG. 84, a flowchart of a process used in aTopListener is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by an ApplicationMediatorreceiving a ViewEvent from a ViewController (step 8400). A determinationis made to whether system service is needed (step 8402). If systemservice is not needed, the process terminates. Otherwise, a TopEvent iscreated with the proper major codes (step 8404). Thereafter, theTopEvent is fired (step 8406). After, a set of TopListeners is invoked(step 8408). This set of TopListeners may include a single TopListeneror many TopListeners. The TopListener receives the TopEvent (step 8410).Thereafter, a determination is made as to whether the major code of theTopEvent is EXIT (step 8412).

If the major code is exit, then the application is exited (step 8414)with the process terminating thereafter. Otherwise, a determination ismade as to whether the major code for the TopEvent is MESSAGE (step8416). If the major code for the TopEvent is message, then the messageis displayed for the application (step 8418) with the processterminating thereafter.

If the major code is not a message, then a determination is made as towhether the major code is a TITLE (step 8420). If the major code for theTopEvent is a title, then the title is displayed for the application(step 8422) with the process terminating thereafter. Otherwise, adetermination is made as to whether the major code for the TopEvent isto execute (EXEC) (step 8424). If the major code is execute, then thedata in the TopEvent specifies an application to be launched (step 8426)with the process terminating thereafter. If none of these major codesare present, the process terminates without taking any action.

E. PlacementListener

With reference now to FIG. 85, a flowchart of a PlacementListener isdepicted in accordance with a preferred embodiment of the presentinvention. The process begins by the ApplicationMediator receiving aViewEvent from a View Controller (step 8500). Thereafter, adetermination is made as to whether ViewController needs to be placed(step 8502). If the ViewController does not need to be placed, theprocess terminates. Otherwise, a PlacementEvent is created with theappropriate major codes (step 8504). Thereafter, the ApplicationMediatorfires the PlacementEvent (step 8506) A set of PlacementListeners is theninvoked (step 8508). In the depicted examples, the set ofPlacementListeners may be a set of one PlacementListener or manyPlacementListeners.

Thereafter, the PlacementListener receives the PlacementEvent (step8510). A determination is made as to whether the major code for thePlacementEvent is ADD (step 8512). If the PlacementEvent is add, thenthe ViewController's component is added to a visual container andViewController is repainted (step 8514) with the process terminatingthereafter. With reference to (step 8512), if the major code is not add,then a determination is made as to whether the placement code is removedin the PlacementEvent (step 8516). If the PlacementEvent is removed,then the ViewController's component is removed from the visual containerand repainted (step 8518) with the process terminating thereafter.Otherwise, the process also terminates.

With reference now to FIGS. 86-F3, flowcharts illustrating processesused in a ViewController are depicted in accordance with a preferredembodiment of the present invention. Turning first to FIG. 86, aflowchart illustrating handling of AWTEvents by a ViewController isdepicted in accordance with a preferred embodiment of the presentinvention. The process begins by receiving an AWTEvent (step 8600). TheEvent is handled by manipulating the GUI according to the GUIspecifications (step 8602). Then, a determination is made as to whetherthe AWTEvent.source is a component to validate (step 8603). If thedetermination is no, then another determination is made as to whether aViewEvent is needed (step 8604). If a ViewEvent is needed, then aViewEvent is created (step 8606). Thereafter, the ViewController isdisabled (step 8608) and the ViewEvent is fired (step 8610) with theprocess then returning.

With reference again to step 8604, if a ViewEvent is not needed, theprocess also returns.

F. ValidationRule

With reference again to step 8602, if the AWTEvent.source is a componentto validate, the process then determines whether the validation level isValidationRule.FOCUS and the AWTEvent is a focus event (step 8612). Ifthe answer to this determination is yes, then the ValidationRules areapplied (step 8614). A determination is made as to whether theapplication was successful (step 8616). If the application wassuccessful, then a determination is made as to whether a validationlevel is equal to ValidationRule.COMPONENT and whether the AWTEvent isan input event (step 8618). This determination is made directly fromstep 8612 if the validation level is not set equal toValidationRule.FOCUS. The AWTEvent is not a focus event. If thedetermination is that the validation level is a ValidationRule for acomponent and the AWTEvent is an input event, then the ValidationRulesare applied (step 8620) and a determination is made as to whether therules were successfully applied (step 8622).

If the rules were successfully applied, then a determination is made asto whether the validation level is equal to ValidationRule.VIEWEVENT(step 8624). If this determination is no, the process then returns tostep 8604 as described above. Otherwise a determination is made as towhether a ViewEvent is needed (step 8626). If a ViewEvent is needed,then ValidationRules are applied (step 8628). A determination is made asto whether the ValidationRules were successfully applied (step 8630). Ifthe ValidationRules were successfully applied, the process then proceedsto step 8606 as previously described.

In any of the steps in which a determination is made as to whether aValidationRule was successful (steps 8616, 8622, and 8630), if theapplication of the rules was unsuccessful, then an error message iscreated (step 8632) with the process then returning. Steps 8612 and 8618describe the various times the ViewController will validate user input.If the setValidationLevel of a VC is set to COMPONENT, then validationis performed on every input event for a component (i.e. key strokes, soonly valid keys are allowed to be inputted). If the validationLevel isFOCUS, then validation is performed when the user hits the Tab key oruses the mouse to move focus out of the current component. If thevalidationLevel is VIEWEVENT, then validation is performed when a viewevent needs to be fired. This situation typically occurs when the userhits the “Ok” or “Next” button for further processing. If a view eventis not needed in step 8626, the process returns.

With reference again to step 8618, if the determination is such that thevalidation level is not a ValidationRule for a component and theAWTEvent is not an input event, then the process proceeds to step 8624as described above.

With reference now to FIG. 87, a flowchart illustrating application ofValidationRules is depicted in accordance with a preferred embodiment ofthe present invention. FIG. 87 is a more detailed description of steps8614, 8620, and 8628 in FIG. 86. The process is applied for each ruledefined for the component (step 8700). A determination is made as towhether ValidationRules are present that have not been applied (step8702). If more rules are present, then the ValidationRule(i) is appliedto the component's value (step 8704). A determination is made as towhether a successful application has occurred (step 8706). If asuccessful application has occurred, the process returns to step 8700 toselect the next rule.

With reference again to step 8706, if the application of the rules areunsuccessful, then an exception is thrown (step 8708) with the processthen returning. With reference again to step 8702, if a determinationthat more ValidationRules are not present for processing, the processalso returns.

G. ViewEvent

With reference now to FIG. 88, a flowchart of a process for firing aViewEvent is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by selecting a ViewListener (step8800) that has not yet been processed from the list of ViewListenersthat have been added to using addViewListener. Thereafter, adetermination is made as to whether ViewListeners are present forprocessing (step 8802). If ViewListeners are present, then invoke themethod ViewListener(i).viewEventPerformed (step 8804). This method is,implemented by a ViewListener (such as an ApplicationMediator) toprocess the ViewEvent passed. Typically, this processing of theViewEvent will occur on a separate thread. Also, the ViewListener maydecide to “consume” the event by calling the consume( ) method on theViewEvent. This essentially specifies that the ViewEvent should not besent to any other ViewListeners left to be processed.

Thereafter, a determination is made as to whether the ViewEvent has beenconsumed (step 8806). If the ViewEvent is not consumed, the processreturns to step 8800 to select another ViewListener. Otherwise, theprocess returns. With reference again to step 8802, if moreViewListeners are not present, the process also returns.

H. Data Refresh

With reference now to FIGS. 89-98, flowcharts illustrating processesused by an ApplicationMediator are depicted in accordance with apreferred embodiment of the present invention. With reference now toFIG. 89, a high level flowchart of the process used by theApplicationMediator is depicted in accordance with a preferredembodiment of the present invention. The process begins by creatingViewControllers (step 8900). Thereafter, the ApplicationMediatorresponds to events (step 8902) with the process terminating thereafter.

With reference now to FIG. 90, a flowchart of a process for handlingDataEvents is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by the ApplicationMediatorreceiving a DataEvent (step 9000). In response to receiving theDataEvent, the ApplicationMediator will send a call to refresh data foreach ViewController handled by the ApplicationMediator (step 9002) withthe process terminating thereafter.

With reference now to FIG. 91, a flowchart of a process for adding alistener is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by the ApplicationMediatorreceiving a request to add a listener (step 9100). The listener type isthen found (step 9102). The listener is then added to a vector (step9104) with the process terminating thereafter.

With reference now to FIG. 92, a flowchart of a process for removing alistener is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by receiving a request to remove alistener (step 9200). The listener type is then found (step 9202). Thelistener is then removed from the vector (step 9204) with the processterminating thereafter.

With reference now to FIG. 93, a flowchart of a process for managingpermissions is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by receiving a request to gatherand set permissions (step 9300). The permissions are then processed(step 9302) with the process terminating thereafter.

With reference now to FIG. 94, a flowchart of a process for handlingViewEvents is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by receiving a ViewEvent (step9400). Thereafter, the ViewEvent is processed (step 9402). Adetermination is made as to whether the major code in the ViewEvent isknown (step 9404). If the major code is known, then a determination ismade as to whether the minor code is known (step 9406). If the minorcode is known, the process then handles the specific request (step 9408)with the process terminating thereafter. A specific request may be, forexample, a RequestEvent, a request for fresh data, a TopEvent, aPlacementEvent, or there may not be a specific request.

With reference again to step 9404, if the major code or minor code instep 9406 is unknown, the process defaults (step 9410) and terminatesthereafter.

With reference now to FIG. 95, a flowchart of a process for refreshingobject data in an ApplicationMediator is depicted in accordance with apreferred embodiment of the present invention. The process begins byreceiving an event (step 9500) (typically a ViewEvent from aViewController or other ApplicationMediator). A determination is made asto whether the processing of the event recieved requires a RequestEvent(step 9502). If a RequestEvent is needed, then a RequestEvent is created(step 9504). Thereafter, the RequestEvent is fired (step 9506). TheApplicationMediator can repeat the processes of creating an event,firing it, processing the results and then go on to the next event tocreate or end. The process then returns to step 9502.

With reference again to step 9502, if a RequestEvent is not needed forthe event, a determination is then made as to whether a TopEvent isneeded (step 9510). If a TopEvent is needed, a TopEvent is created (step9512) and the TopEvent is fired (step 9514). Thereafter, the processproceeds to step 9508 as described above.

With reference again to step 9510, if a TopEvent is not needed, adetermination is then made as to whether a PlacementEvent is needed(step 9516). If a PlacementEvent is needed, then a PlacementEvent iscreated (step 9518). Thereafer, a ViewController is selected (step9520). The PlacementEvent is fired using a component from theViewController (step 9522) with the process then proceeding to step9508.

With reference again to step 9516, if a PlacementEvent is not needed,then a determination is made as to whether a data refresh is needed(step 9524). If a data refresh is needed, then the data is accessed(step 9526). Thereafter, the refresh method on the ViewController orApplicationMediator is called. (step 9528) with the process thenproceeding to step 9508 as described above. With reference again to step9524, if a data refresh is not needed, then the process terminates.

With reference now to FIGS. 96 and 97, diagrams illustrating processesused to refresh object data is depicted in accordance with a preferredembodiment of the present invention. The data coming in can be oneobject or an object containing multiple objects, such as a Vector ormore generically, a list. This data is represented by the type “Objectdata;” the process of data refresh includes seeing if the data is asingleton and if data is handled (a recognized type), then format it(cast) into the recognized type and then call refresh again in the sameview controller. For example, refresh(Object data) yieldsrefresh(Customer data) if this data type is handled (a recognizedaggregate type such as Vector), then the data is formatted (cast) intothe recognized type. Then refresh is called again in the same viewcontroller. For example, refresh(Object dataAggreate) yieldsrefresh(Vector data).

If the data is an aggregate (not a singleton), and if the data is nothandled, then iterations are performed over the aggregate and refresh iscalled for each object in the aggregate. For example, refresh(ObjectdataNotSupportedAggregate) yields refresh (ObjectdataNotSupportedAggregate (i)) for each i.

When a singleton data type is supported, has been cast, and a newrefresh has been called, there are a plurality of actions that canresult. These actions include, for example: updating one or morecomponents, containers or beans; updating the reference to the localdata model; application of ValidationRules again; and even the firing ofa new ViewEvent. Thus, for each refresh in the plurality of refreshespossible from the initial refresh, a plurality of actions can resultfrom the plurality of possible actions.

With reference now to FIG. 96, a flowchart of a process for refreshingdata in an ApplicationMediator is depicted in accordance with thepreferred embodiment of the present invention. The process begins byreceiving a call to refresh object data (step 9600). Thereafter, anaccess of data is performed (step 9602). Data is accessed by theApplicationMediator rarely. The reasons to access data in anApplicationMediator arise around the need to activate another subApplicationMediator or a ViewController. Thereafter, ApplicationMediatoris selected for processing (step 9604). This step is used to identifyunprocessed ApplicationMediators for processing. Thereafter, anApplicationMediator(i).refresh(Object data) is performed (step 9606).Thereafter, a determination is made as to whether moreApplicationMediators are present for processing (step 9608). If moreApplicationMediators are present, the process returns to step 9604.Otherwise, a ViewController is identified for processing (step 9610).This step is used to select unprocessed ViewControllers for processing.A ViewController (i).refresh(Object data) is performed (step 9612). Thisstep is described in more detail in FIG. 97 below. Thereafter, adetermination is made as to whether more ViewControllers are present forprocessing (step 9614). If additional ViewContollers are present, theprocess returns to step 9610. Otherwise, the process returns.

With reference now to FIG. 97, a flowchart of a ViewContoller refreshprocess is depicted in accordance with the preferred embodiment of thepresent invention. FIG. 97 is a more detailed description of step 9612in FIG. 96. The process begins by receiving a request to refresh (Objectdata) (step 9700). Thereafter, a determination is made as to whether thedata is a singleton (step 9702). If the data is not a singleton, then adetermination is made as to whether the data is handled as an aggregate(step 9704). If the data is to be handled as an aggregate, then adetermination is made as to whether additional objects are present inthe aggregate that are unprocessed (step 9706). If additional objectsare present, then the use object process is performed (step 9708). Byusing an object, an unprocessed object is selected with a recursive callof refresh on that object. Once that object (and all of its objects) areprocessed, the next object is then selected. Thereafter, the processreturns to step 9706. When no more objects are present, the processreturns.

With reference again to step 9704, if the data is not to be handled asan aggregate, the process then proceeds to step 9712 as described below.

With reference again to step 9702, if the data is a singleton, adetermination is made as to whether the data is an instance of arecognized type T (step 9710). Type “T” is any Java data model type thatthe JTC systems is currently supporting. For example, you may support atype Object data; and a type KeyValue data; Until you then add supportfor XMLData data, T cannot be of that type. Once the code is added forXMLData type, T can be of that type. If the data is an instance of arecognized type T, then the data is cast into a recognized type T (step9712). Thereafter, a call refresh for type T is made (step 9714). Thiscall may be, for example, refresh (T data). Thereafter, the local stateis updated (step 9716), and the GUI is updated (step 9718) with theprocess then returning. With reference again to step 9710, if the datais not an instance of a recognized type then an ignore or error isgenerated (step 9720) with the process then returning.

With reference now to FIG. 98, a flowchart of a process used to processRequestEvents is depicted in accordance with a preferred embodiment ofthe present invention. The process begins by the firing of aRequestEvent (step 9800). Thereafter, the process will select aRequestListener (step 9802). A determination is made as to whether moreRequestListeners are present for processing (step 9804). If aRequestListener is present, then the process executesRequestListener(i).requestEventPerformed (step 9806). Thereafter, adetermination is made as to whether the RequestEvent has been consumed(step 9808). If the RequestEvent has not been consumed, the processreturns to step 9802 to select another RequestListener for processing.Otherwise, the process returns. With reference again to step 9804, ifadditional RequestListeners are not present for processing, all of theRequestListeners have been processed and the process returns.

I. Hierarchical ApplicationMediators

The present invention provides for the use of hierarchicalApplicationMediators for handling events from ViewControllers. In such asystem, ApplicationMediators are arranged in a hierarchical fashion inwhich different ApplicationMediators may handle different types ofevents or perform different functions. If graphed, theApplicationMediators would look like the tree in which nodes representApplicationMediators. Events would be received by the lowest levelApplicationMediators, those farthest away from the root. One event willpercolate up the graph and then the event might cause actions to a groupof ApplicationMediators from the set of ApplicationMediators which inturn may results in a set of actions from the plurality of viewcontrollers. Another way to view it, “event” moves up the graph and thencome back down-in numerous possible paths.

Each node in the graph is an ApplicationMediator. View controllers. Thepartitioning of the nodes are based on some logical heuristic. Onexample is the higher the node, the higher semantic level the code has.

With reference now to FIG. 99, a flowchart of an initialization processfor creating hierarchical ApplicationMediators is depicted in accordancewith a preferred embodiment of the present invention. The process beginsby creating a Top ApplicationMediator (step 9900). TopListeners areadded (step 9902), and RequestListeners are added (step 9904).Thereafter, PlacementListeners are added (step 9906) and ViewListenersare added (step 9908).

The concept here is that when the application starts the top level AM isprovided with the highest level listeners. Then, any Ams created aschildren AMs are initialized with the same listeners as specified by thetop level AM. Once the Listeners are created they will wait to be calledback via a fireEvent invocation . . . topEventPerformed( ),viewEventPerformed( ), requestEventPerformed( ),placementEventPerformed( ) etc.

Next, a second level ApplicationMediator is created (step 9910), and theTopListeners are cloned (step 9912). The RequestListeners are cloned(step 9914), and the PlacementListeners are cloned (step 9916).

Cloning means to create an exact copy, which means that the copy has itsown specific reference while a non-cloned copy would have the samereference as the original, which means that if a person has a dollaramount and choose to copy the amount into another object without cloningit then any changes made to the copy will also affect the original,while the original is cloned rather than just copied, any changes to thecloned object will only affect the clone. Therefore, the reason to clonethe listeners here is so that children ApplicationMediators do not havethe same Vector instance as the parent ApplicationMediators. If theVector instance was the same, then the children ApplicationMediators andtop level ApplicationMediator would always share the same lists oflisteners.

Thereafter, the top ApplicationMediator is added as a ViewListener tothe second level ApplicationMediator (step 9918). A determination isthen made as to whether a ViewController is to be added (step 9920). Ifa ViewController is not to be added, then a determination is made as towhether additional second level ApplicationMediators are to be added(step 9922). If additional second level ApplicationMediators are to beadded, the process then returns to step 9910. Otherwise, a determinationas to whether a lower level ApplicationMediator is to be added (step9924).

If a lower level ApplicationMediator is to be added, then the lowerlevel ApplicationMediator is created (step 9926). The TopListeners arecloned (step 9928) and the RequestListeners are cloned (step 9930).Thereafter, the PlacementListeners are cloned (step 9932). Then, theupper level ApplicationMediator is added as the ViewListener (step9934). The upper level ApplicationMediator is the ApplicationMediator inthe level above the one created.

If there are no more lower level ApplicationMediators then theinitialization process completes and application is ready to begin.Also, lower level ApplicaitonMediators and ViewControllers may becreated at any time while the application is running.

Thereafter, the process returns to step 9920. With reference to step9920, if a ViewController is to be added, then the ViewController iscreated (step 9936). Then, the parent level ApplicationMediator is addedas the ViewListener (step 9938) with the process then proceeding to step9922.

A parent level ApplicationMediator is the application mediator thatmanages several ApplicationMediators and/or ViewControllers. The usagefor this is when functions of an application are nested. For example,assume an application has a function to display an interest ratecalculator. This calculator has maybe several screens associated withit. Therefore, an CalculatorApplicationMediator is created to managethose screens. Now, assume that this calculator function will be used bytwo different higher-level processes such as a Auto Loan calculator anda Home Mortgage calculator. So the AutoLoanAM and HomeMortgageAM wouldbe parent AMs for the CalculatorAM. The parent/child APPLICATIONMEDIATORcommunication is done through ViewEvents and refresh just likeAPPLICATIONMEDIATOR to VIEWCONTROLLER communication. In other words, achild ApplicationMediator represents a child or sub-process that can bere-used in many places.

With reference now to FIG. 100, a flowchart of a process for handlingevents in a hierarchical ApplicationMediator system is depicted inaccordance with a preferred embodiment of the present invention. Theprocess begins by receiving user action input (step 10000). AComponentEvent is created and fired (step 10002). The ViewControllerreceives the ComponentEvent (step 10004). A determination is then madeas to whether the ComponentEvent is a ViewEvent(step 10006). If theComponentEvent is not a ViewEvent, the process returns to step 10000.Otherwise, the ViewController creates and fires a ViewEvent (step10008). The ViewController's parent ApplicationMediator receives theViewEvent (step 10010).

A determination is made as to whether the ApplicationMediator is able tohandle the ViewEvent (step 10012). If the ApplicationMediator is able tohandle the ViewEvent, the ViewEvent is processed (step 10014).Thereafter, a determination is made as to whether the processing hascompleted (step 10016). If the processing has completed, the processreturns to step 10000. Otherwise, the ViewEvent is refired (step 10018).The parent ApplicationMediator to the current ApplicationMediatorreceives the ViewEvent (step 10020) with the process then returning tostep 10012.

With reference again to step 10012, if the ApplicationMediator is notable to handle the ViewEvent, the process proceeds directly to step10018 as described above.

J. Virtual Application Mediators

With reference now to FIGS. 101-104, flowcharts illustrating stateencoding in an ApplicationMediator is depicted in accordance with apreferred embodiment of the present invention. An ApplicationMediatorcan be built as a state machine loaded by properties file, whichdescribes other ApplicationMediators. These other ApplicationMediatorsare also referred to as Virtual encoding language to describe the statetransitions of an ApplicationMediator. Encoding is provided forViewEvents, refresh of data, SettingProperties, SettingPermissions, andfor methods that may alter the ApplicationMediator state. The actualVirtual ApplicationMediator used may be described in and passed inSetProperties.

An AWTEvent is generalized with increased semantics first as aViewEvent, then as a RequestEvent, PlacementEvent and TopEvent.

Numerous heuristics may be employed that can determine how to solvemediation, such as how to encode a RequestEvent, why a RequestEvent andnot a TopEvent or ViewController action.

More than one semantic event can be generated for each ViewEvent.

The Application Mediator interface provides default behavior to manageViewControllers, ApplicationMediators, and to add/fire/removePlacementListeners, ViewListeners, and a TopListener. TheApplicationMediatorImpl implements methods in the ApplicationMediatorand JTC interfaces.

A dispatching state machine is used to manage all of these actions. Asindicated by the name, a state machine consists of a finite set ofstates, a set of possible transitions between states, and, optionally,one or more actions to be performed when a transition is made betweentwo states. State recognition will be based on the object beingmonitored. For example, for a ViewEvent the state is typicallydetermined by a subset of the source of the event, the major code, theminor code and possibly the value of the data reference. Examples ofpossible actions are to make an existing ViewController visible, tocreate/fire a PlacementEvent, to create/fire a RequestEvent, or tocreate/fire a TopEvent. It is be possible to “hand build” the finitestate machine for every ApplicationMediator, but this route is verytedious.

Instead, according to the present invention, the virtualApplicationMediator builds the finite state machine from a set oftransition rules that recognize the current state and if matched,trigger a state transition and associated actions. In general, it isunpractical to build a language within a language. If the encoding ofthe transition rules included control statements (i.e. if/then/else,while, switch) it is better to implement the ApplicationMediator in theprogramming language at hand, Java. If the definition of the transitionrules are indeed simple, not control structures and theApplicationMediator has little state except the Vectors of itsApplicationMediators, ViewControllers, Properties, Permissions, andResources, then encoding becomes simple, flexible, powerful and easy tomanage. The resulting benefit is that one set of ApplicationMediatorcode can be used to implement numerous virtual ApplicationMediatorssimply by changing the transition rules via the setProperties method.

In FIG. 101, a flowchart for a process for building a state machine isdepicted in accordance with a preferred embodiment of the presentinvention. The process begins by loading a configuration file ofApplicationMediators state stanzas (step 10100). A multi-dimensionallist of the configuration file is built (step 10102). Amulti-dimensional list has more than one dimension, traditional list area single dimension implementation such as a list of numbers, orcollection of elements. Multi-dimensional list would have, as itselements, containers that also represent containers. For example, a listof lists. This is clearly a list, yet the elements themselves are lists.This means a particular list in one dimension may be referenced whileaccessing the elements of that list in another dimension. ExamplecolorList is a list of colors. To reference a color, a call would bemade, such as colorList[2] and the color that is stored at location 2would be obtained. If it is desired to store several list of list ofcolors and access to a particliar color that is in color list 2, atlocation 4 is desired, the color would be referenced as listOfColors [2][4]. Thereafter, the state machine processes events and calls (step10104) with the process terminating thereafter.

Turning now to FIG. 102, example table entries from the loading of aconfiguration file for a virtual ApplicationMediator is depicted inaccordance with a preferred embodiment of the present invention.

With reference now to FIGS. 103 and 104, an access state machine used todetermine whether processing of a ViewEvent is needed is depicted inaccordance with a preferred embodiment of the present invention. Theprocess begins by receiving a ViewEvent (step 10300). After theViewEvent.source is located (step 10302), a determination is then madeas to whether the source is in a virtual ApplicationMediator list. (step10304). If the ViewController is not located in the dispatch table, theprocess returns. Otherwise, a determination is made as to whether aminor code has been set for the ViewEvent (step 10306). If a minor codehas been set for the ViewEvent, then the table entries locate source/ViewEvent.major/ViewEvent.minor tuple (step 10308).

The process then determines whether more table entries are present forprocessing (step 10310). If more table entries are not present forprocessing, the process returns. Otherwise, table entry (i) is used(step 10312). A determination is made as to whether table entry(i) has amajor equal to ViewEvent.major and/or entry(i) minor is equal toViewEvent.minor (step 10314). If the table does not have a major equalto the major for the ViewEvent, the process returns to step 10310 to seeif more table entries are present for processing. Otherwise, adetermination is made as to whether more action entries are present forentry(i) (step 10316). If additional action entries are not present, theprocess also returns to step 10310.

With reference again to step 10306, if the ViewEvent is not a minor codeset, then the table entries matching source and the major pair for theViewEvent are located (step 10318) with the process then returning tostep 10310.

With reference again to step 10316, if more action entries are presentfor entry(i), the process then proceeds to FIG. 104 and determineswhether action(i) is equal to RE (step 10320). If action(i) equals RE,then a RequestEvent is created with action(i) major, action(i) minor,ViewEvent.data (step 10322). Thereafter, the RequestEvent is fired (step10324) with the process then returning. With reference again to step10320, if action(i) does not equal to RE, then a determination is madeas to whether action(i) equals TE (step 10326). If action(i) equals TE,then a TopEvent is created with an action(i) major and an action(i)minor (step 10328). Thereafter, the TopEvent is fired (step 10330) withthe process then returning.

With reference again to step 10326, if action(i) does not equal TE, thena determination is made as to whether action(i) is equal to PE (step10332). If action(i) is equal to PE, then a PlacementEvent is createdwith an action(i) major and an action(i) minor along with a ViewEventsource (step 10334). Thereafter, the PlacementEvent is fired (step10336) with the process returning. With reference again to step 10332,if action(i) does not equal to PE, then determination is made as towhether action(i) is equal to VIEWCONTROLLER (step 10338). If action(i)is equal is VIEWCONTROLLER, then a refresh data is performed on thesource for the ViewEvent (step 10340) with process then returning. Withreference again to step 10338, if action(i) does not equalViewController, then an error has occurred and an error is generated(step 10342) with the process then returning.

K. Serialization/Deserialization

When communications take place between the client and the server, it isconvenient to “pack” an object into a single entity, send it over thenetwork, and then “unpack” it at the other end. The Serialize packs theobject for transmission and the Deserializer unpacks it at the otherend.

With reference now to FIG. 105, a diagram of a serializer system isdepicted in accordance with a preferred embodiment of the presentinvention. Serializer system 10500 is used to serialize data fortransfer. With reference to FIG. 106, a deserialier is depicted inaccordance with a preferred embodiment of the present invention.

When an object is serialized, the object is being written to an externalsource. The size of the data array is first written and then the data issent to a serializer for serialization. Typically, a serializer willlook up the code for the data element, write the code to the stream, andthen look up the serializer for the element. If the serializer for theelement exists, then the serializer is allowed to write the element.Otherwise, if the element is “externalizable”, it is allowed to writeitself. In this last case, it is a call to the method writeExternal onthe data element. If the element does not have a serializer and is notexternalizable, then it is written as a standard object. Such a writingof the element as a standard object is expensive in terms ofserialization space and time and should not happen under normalcircumstance.

When an object is read, the size of the data array is read. Thereafter,a base serializer class is used to read each data element. The code forthe data element is read and looked up to see if a serializer exists forthe code. If a serializer exists, then the serializer reads the dataelements and creates the object. Otherwise, an instance of the elementtype is created. If the element is externalizable, the element isallowed to read itself. This may be accomplished through a call toreadExternal on the data element. Otherwise, the data element is readinto an object.

The default serialization provided by Java writes the class name of thedata element then the attribute name and the value for each attribute ofthe data element. The size benefit provided by the present inventioncomes from writing a code representing the element type instead of thetype name and the attributes that are required to recreate the dataobjects without writing the names of the attributes. For example, aninteger is written as follows: The class name [java.lang.Inter], theattribute name [value java.lang.Number], the attribute value [00 00 0008] size: 81 bytes. Alternatively enhanced serialization: the code [01],the value [00 00 00 08] size 11 bytes.

With reference now to FIGS. 107A-107C, a diagram illustrating an objectarray is depicted in accordance with a preferred embodiment of thepresent invention. Typically user defined data classes extend a classsimilar to that shown in FIGS. 107A-107C. Specifically, FIGS. 107A-107Cillustrates an object array that contains all the attributes of theuser-defined data. The subclasses just provide getter/setter methods(i.e. getXXX( ) and setXXX( ) methods where XXX is a particularattribute name). These getter and setter methods just access the objectarray in FIG. 107 using getData and setData methods based on an indexfor the attribute. This is a common extension of using an indexed-arraydata model combined with an attribute-based object model. The advantageof this model is to reduce the serialization size by removing theattribute names that are typically outputted in the default Javaserialization mechanism.

Turning now to FIGS. 108A-108B, a diagram illustrating code used in aserialization method is depicted in accordance with a preferredembodiment of the present invention. The mechanism of the presentinvention adds to the serialization method 10800 provided in FIGS.108A-108B. To use the special serialization, any and all user-defineddata classes can extend the BaseDataS class 10800 illustrated in FIG.108. In Java, the default Java serialization for an object can beoverridden by implementing the Externalizable interface illustrated inFIG. 109 and implementing the methods readExternal and writeExternal forreading/writing from/to input/output stream.

Method 10800 uses the BaseSerializer class, as illustrated in FIGS.110A-110D for implementing default serialization for many of Java's baseclasses and even some of Java's collection classes. Also, the user canspecify a serializer for other data classes by implementing theSerializerIF interface 10900 in FIG. 109 and listing the serializer'sclass name on the same line after the data class name in theClassNames.ini file separated by a space. If no serializer is specifiedand none are provided by the BaseSerializer 11000, then the default Javaserialization method for that class is used.

Using this new serialization mechanism coded in the read/write Externalmethods of BaseDataS method in FIGS. 108A-108B and BaseSerializer method10800 in FIG. 109 provides the benefits of reduced serialization size.The combination of the two mechanisms above provide the 80% reduction inserialization size.

In these examples, the serialization process of the present invention isable to reduce the serialization size further by completely removing anyfull-path class name strings that are typically outputted in the defaultJava serialization. Of course, depending on the implementation, otherinfomation may be removed and processed a similar manner to thefull-path class name strings.

The number and length of these class name strings can be incur a highamount of overhead for serialization. The only disadvantage is that theactual class names must be provided on both sides of serialization(reader/writer). The class names are hashed and the hash code is storedin the serialization instead of the actual full class name. (This is whythe classes need to be listed in the ClassNames.ini file and provided oneither side of the client/server that needs serialize/unserialize thedata). Another way to reduce this dependency is to automatically sendthe class names once before any other communication betweenclient/server is done.

The ClassNames.ini file contains a sequence of lines that are either aclass name for a user-defined data class or a class name followed by aserializer's class name if the user created their own serializer forthat particular data class. If no serializer is provided and the dataclass is not in the BaseSerializer, then the default Java serializer forthe data class is used. The process of reading this file produces atable that contains the class name, a hash code, and a serializer. Theflowchart in FIG. 111 shows how the ClassNames.ini file is read.

Since the read will be buffered, an empty BufferedRead object isdeclared (step 11102). A FileReader object is created and passed to theconstructor for the BufferedRead object (step 11104). Each line of thefile is read sequentially (step 11106). A determination is then made asto whether there is additional data in the file (step 11108). If so,control passes to the finalization code (step 11130). Otherwise, theline is trimmed (step 11110), which means all leading and trailingspaces are removed. Next, a determination is made as to whether the linelength is 0 or it begins with a # (indicating a comment) (step 11112).If not, the process returns to step 11106 where another line is read.For lines with data, a string tokenizer is created and the first tokenis read (this is the class name) and the Java method hashcode() isapplied to the class name to find an associated integer value (step11114); this integer value is used for hash table processing.StringTokenizer is a built-in Java class that breaks a string into itscomponents, much like a sentence could be broken into separate words.Next, an empty serializer is created (step 11116).

A determination is then made as to whether there is another token (step11118). If so, then it is fetched (this is a user-defined serializername) (step 11120) and a serializer is created using this name (step11122). If this causes an exception, it is ignored (step 11124) and theclass name, hash code, and serializer name are added to the table (step11126). Control returns to step 11106 to read the next line from thefile. If an exception occurs at any time while processing the ini file,it is ignored (step 11128). The finalization code closes the file (step11130); any exception is ignored (step 11132). Then the table is written(step 11134) completing the process of reading the ini file. Withreference again to step 11122, if there are no additional tokens in thetokenizer, the process proceeds directly to step 11126 as describedabove.

L. Permissions

A permission is a capability that a user is allowed to perform. Forexample, given a user (defined with a user id, password, location,etc.), this user's capabilities may include running ApplicationMediator1 and 2, but not 3. Similarly, the same user may be allowed to operateViewController 1 and 2 in ApplicationMediator 1, but not ViewController3. Similarly, the same user may be allowed to use all of the GUIcomponents in ViewController 1 in ApplicationMediator 1, except the“next” button, which is disabled.

A permission is the encoding of the above functionality. It is definedas part of the enterprise deployment business processes and securitymodel. Enterprise support to maintain storage of permission data isrequired for JTC permissions to operate.

For example, using the above description, (Joshua: “AM1=yes AM2=yesAM3=no”) would be defined before deployment and stored in a database andlater to be sent to the client. The client program knows that, while thecurrent user is Joshua, AM3 cannot be started.

For another example, [Jacob: “AM1: VC1=yes VC2=yes VC3=no”] would bedefined before deployment and stored in a database and later to be sentto the client. Now the client program knows that, while the current useris Jacob and running AM1, Jacob cannot use VC3.

For example, [John: “AM1.VC1: customerlist=yes ok=yes previous=yesnamefiled=yes next=no”] would be defined before deployment and stored ina database and to be sent to the client. Now the client program knowsthat, while the current user is John and running AM1, and in VC1, thecustomerlist, ok button, previous button, and namefield are enabledwhile the next button is disabled. The JTC ApplicationMediators andViewControllers alter their internal state when setPermissions method iscalled. They do not hard code user permission information. They do checka system specific user session and compare it to their permission stateto determine what actions to alter for ViewEvents, PlacementEvents, etc.

Likewise, possibly at build time, the ApplicationMediators andViewControllers, when called with getPermissions, will return the setsof “keys” that they will react to at runtime. The actual value of thekeys (for example, “yes” above) is implementation and business specific.

With respect to permissions, user will typically login to anApplication. Login validation is typically provided by externalservices. The user may have a role based on various attributes, such asuser ID, password, location, or time. After logging in, the user willexecute the Application as defined by the role. Sometimes, functionsprovided by another role not accessible by the current user may berequired. For example, a cashier may need to void a transaction,requiring the manager to issue an override. For another example, asalesperson may need a branch banking loan officer to approve a loan. Insuch a case, a new user will login to supplement or replace the currentuser. The new user can execute the Application according to the newrole. In such a case, more functionality may be enabled. Thereafter, thenew user will logout. The architectural pattern of the present inventionprovides a key/value pair of permissions model to support such roles. Insuch a case, ApplicationMediators may enable and disable ViewControllerswhile ViewControllers enable and disable GUI parts. In such a case, anApplicationMediator will return a list of “keys” that representalterable items. These are usually ViewControllers. New ViewControllerswill return a list of “keys” that represent alterable items. These areusually GUI related components, containers and beans. A user managementsystem may create a GUI tool to map role definitions to theApplicationMediator and ViewController permission keys (i.e. IBM's OnDemand Server). In such a case, for example, for each key, a welldefined value is stored that defines the alterable item. Thesekeys/value mapping are stored in a database. In setting permissions, ifa login is successful, the login and service provider will provide thekey/value mappings. For example, ApplicationMediators will be passed thekey/value mappings. In turn, the ApplicationMediators will pass them tothe ViewControllers associated with the ApplicationMediators.

The persmission information is almost always retrieved or changed via achange in user login (security). A JTC application may choose to createa simple list of the user login sessions. Each session may containpermissions for the user as well as properties, references toApplicationMediators and references to ViewControllers. A policy of asingle current user, two current users or multiple current users may beimplemented. In all cases, the ApplicationMediators and ViewControllersdo not know why properties are being set, they are just set because toplevel ApplicationMediator receives the properties data from the serveror the login session list and calls the setPermissions method.

FIGS. 112-119 are a series of flowcharts describing the process forgetting and setting permissions are depicted in accordance with apreferred embodiment of the present invention. With reference now toFIG. 112, a high level flowchart of a process for obtaining permissionsis depicted in accordance with a preferred embodiment of the presentinvention. The process begins by determining whether a user profile hasbeen created (step 11200). If a user profile has not been created, theprocess creates a user profile (step 11202). Thereafter, the processreturns to step 11200. If a user profile has been created, then programpermissions are obtained (step 11204). These program permissions arestored as permission keys in a database (step 11206) with the processterminating thereafter.

With reference now to FIG. 113, a flowchart of a process for gettingprogram permissions is depicted in accordance with a preferredembodiment of the present invention. The process is iterated for eachApplicationMediator created (step 11300). A determination is made as towhether more ApplicationMediators are present (step 11302). If moreApplicationMediators are present that have not been processed, then thepermission keys for the particular ApplicationMediator are added to thelist (step 11304) with the process then returning to step 11302. Withreference again to step 11302, if more ApplicationMediators are notpresent for processing, then a list of keys are returned (step 11306)with the process terminating thereafter.

With reference now to FIG. 114, a flowchart of a process for obtainingApplicationMediator permissions is depicted in accordance with apreferred embodiment of the present invention. The process begins byiterating for each ViewController created (step 11400). A determinationis then made as to whether more ViewControllers are present forprocessing (step 11402). If more ViewControllers are present, then thepermission keys for the ViewController are obtained and added to thelist (step 11404) with the process then returning to step 11400.

With reference to step 11402, if more ViewControllers are not presentfor processing, then the names of the ViewControllers are added to thelist formed for each ViewController (step 11406). Next, a list of keysare returned (step 11408) with the process terminating thereafter.

With reference now to FIG. 115, a flowchart of a process for obtainingViewController permissions is depicted in accordance with a preferredembodiment of the present invention. The process begins by iterating foreach component, container or bean created (step 11500). A determinationis made as whether more components are present for processing (step11502). If more components are present, a determination is then made asto whether the component is alterable at run time based on permissions(step 11504). If the component is not alterable at run time, then theprocess returns to step 11502 to process another component. Otherwise, akey representing the component is created (step 11506). The key is thenadded to the list (step 11508) with the process then returning to step11500. With reference to step 11502, if more components are not present,then a list of keys are returned to step 11510 with the processterminating thereafter.

With reference now to FIG. 116, a flowchart of a process for settingpermissions is depicted in accordance with a preferred embodiment of thepresent invention. The process begins by determining whether the user islogged in (step 11600). If the user is not logged in, then a loginprocess is performed (step 11602) with the process then returning tostep 11600.

When the user is logged in, program permissions are obtained from thedatabase (step 11604). Thereafter, the program permissions are set (step11606) with the process then terminating.

With reference now to FIG. 117, a flowchart of a process for settingprogram permissions is depicted in accordance with a preferredembodiment of the present invention. The process begins with iteratingthrough each ApplicationMediator present and selects anApplicationMediator for processing (step 11700). A determination is thenmade as to whether more ApplicationMediators are present (step 11702).If more ApplicationMediators are not present, the process then returns.Otherwise, permission keys are set for the particularApplicationMediator being processed (step 11704) with the process thenreturning to step 11700.

With reference now to FIG. 118, a flowchart of a process for settingApplicationMediator permissions is depicted in accordance with apreferred embodiment of the present invention. The process begins byselecting a ViewController for processing and will iterate through eachViewController present(step 11800). Thereafter, a determination is madeas to whether more ViewControllers are present (step 11802). If moreViewControllers are present for processing, the process then setspermission keys for the particular ViewController (step 11804) with theprocess then returning to step 11800. With reference back to step 11802,when additional View Controllers are not present for processing, thenfor each ApplicationMediator permission key, the value is remembered andapplied to the ViewController at one time (step 11806) with the processreturning thereafter.

With reference to FIG. 119, a flowchart of a process for settingViewController permissions is depicted in accordance with a preferredembodiment of the present invention. The process begins by selecting apermission key for processing and will iterate for each permission key(step 11900). A determination is then made as to whether more permissionkeys are present (step 11902). If more permission keys are present, theprocess then gets the value for the key (step 11904). Thereafter, avalue is applied to the particular components (step 11906). The valuemay be, for example, related to the method setVisible, setEnabled, orsetAttribute. The process then returns to step 11900. With reference tostep 11902, if more keys are not present, the process then returns.

VIII. EXAMPLE PATTERNS

FIGS. 120-123 illustrate example patterns using the architecturalpattern of the present invention. Turning now to FIG. 120, a samplepattern for a Uniform resource locator (URL) mapper 12000 is depicted inaccordance with a preferred embodiment of the present invention. URLmapper 12000 is a pattern which provides a mapping to URL links that arecached. The user interface 12002 is part of the ViewController. Userinteractions that are AWT events are translated to ViewEvents that areprocessed by the ApplicationMediator 12004. These ViewEvents becomeRequestEvents that are sent via the transporter 12006 to the destination12008. The RequestEvent responses carry the hypertext markup language(HTML) and are cached.

With reference now to FIG. 121, a data model using the architecturalpattern of the present invention is depicted in accordance with apreferred embodiment of the present invention. In this example, pattern12100 in FIG. 121 illustrates the use of data models. The user interface12102 is implemented as multiple classes that can interact with an XMLdatabase 12104. ViewEvents generated as a result of user interaction aretranslated into RequestEvents by the ApplicationMediator 12106. TheseRequestEvents are sent to the destination 12110 via the transported12108. The RequestEvent responses carry XML objects that are put intothe XML database.

Turning next to FIG. 122, a diagram illustrating interaction with loggeddata objects processed in a streaming environment is depicted inaccordance with a preferred embodiment of the present invention. In thisexample, the pattern 12200 in FIG. 122 illustrates interaction with livedata objects processed in a streaming environment. The User interface12202 is implemented as multiple classes that can interact with aCustomer database 12204. There is also asynchronous interaction withCurrencyCounter 12206 that keeps track of the data objects. ViewEventsgenerated as a result of user interaction are translated intoRequestEvents by the ApplicationMediator 12208. These RequestEvents aresent to the destination 12212 via the transported 12210. This is anEnterprise Java Beans application where EJB objects are sent back aspart of the responses. These objects affect both the Customer database12204 and the CurrencyCounter 12206. The Customer data 12204 can also beaccessed remotely through an Remote Method Invocation (RMI) server12214. The CurrencyCounter 12206 also communicates asynchronously withan RS232 port 12216.

A JTC program and its elements (i.e. Transporters, Destinations,ApplicationMediators, ViewControllers, components/containers, beans andthe main program) all implement the JTC interface. If a reference to themain program is available, a call may be made to getJTCs and a list ofall the objects that main allocates that implement the JTC interface arereturned. This mechanism is independent of the AWTEvent, ViewEvent,RequestEvent paths.

Iteration can be performed over this list and a determination can bemade what the object types with the type of the object, the type oflisteners it supported by the objects can be identified. Therefore, aprocess can be added to objects as a listener as long as the callbackmethod is supported. This can be done for any object type. This normallyincludes JTC objects and AWT (includes AWT and JFC) objects.

For any object, numerous events may be generated. These events areassociated with an interface. If an object is added as a listener to theobject for these events, the object must implement the numerous methodsassociated with the numerous interfaces to support the numerous eventsfrom the various types of objects.

After the event arrives, numerous actions may result ranging fromlogging, to tracing, to connecting to a network and sending them out ofthe box, to generating further events. A tracing program can in fact bea JTC program and it can be hooked (traced) while it is tracing anotherJTC program. A graph-tree of programs may be built where the root is thetop level program and the root listens to its children and so forth,until the leaves are reached and they are just running JTC programs.

Although events such as AWTEvent, ViewEvent, RequestEvent, and TopEvent,still occur anywhere in the graph, they do not cause the hooking viagetJTCs/getAWTs to start. This is done primarily when the program islaunched. It could be initiated in the event path. Alternatively, theTopEvent may cause the hooking to start. For example, the user hits“help” in a ViewController that causes a ViewEvent to a RequestEvent tolaunch a request for help and it also sends a TopEvent to trace theprogram and send the events to a call center over the network.

With reference next to FIG. 123, a diagram illustrating nonintrusivecaching, tracing, or logging using an architectural pattern is depictedin accordance with a preferred embodiment of the present invention.Pattern 12306 in FIG. 123 shows how non-intrusive caching, tracing, orlogging can be added to any thin client pattern. The main sequence ofevents from the application perspective is ViewEvents generated in theViewControllers 12302 being handled by the ApplicationMediator 12304 andtranslated into appropriate RequestEvents. These RequestEvents arepassed on to the destination 12308 via the transported 12306. ASnooperApplicationMediator 12310 runs in parallel with the application.The SnoopListener monitors ViewEvents and RequestEvents and, asappropriate, issues RequestEvents to the logging system. TheSnoopDestination 12312 can log, trace or cache information on anappropriate storage device 12314.

Thus, the present invention provides an architectural pattern that maybe used to create Internet friendly Java applications, which are small,fast, and flexible. Additionally, through the architectural pattern ofthe present invention, the object reuse on a client may be between 50 to100 percent. Additionally, the architectural pattern and methodology ofthe present invention reduces the time needed to develop an application.By the separation of the functions and processes as described above, aclient application may be designed, implemented, and tested as paralleltasks in the client application. By the separation of the functions andprocesses as described above, a client application may be designed,implemented, and tested in parallel with the server application. Throughthe present invention, lock-step designing and testing may beeliminated. The addition of new network protocols, new servers and newdata models are straight forward and easily performed. Also, changingthe graphical user interface to change the look and feel of anapplication also is easily performed through the compartmentalizationand segregation of duties and functions set out in the architecturalpattern of the present invention.

It is important to note that while the present invention has beendescribed in the context of a fully functioning data processing system,those of ordinary skill in the art will appreciate that the processes ofthe present invention are capable of being distributed in the form of acomputer readable medium of instructions and a variety of forms and thatthe present invention applies equally regardless of the particular typeof signal bearing media actually used to carry out the distribution.Examples of computer readable media include recordable-type media such afloppy disc, a hard disk drive, a RAM, and CD-ROMs and transmission-typemedia such as digital and analog communications links.

The description of the present invention has been presented for purposesof illustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Forexample, although the depicted architectural pattern is illustrated in aJava programming environment, the architectural pattern of the presentinvention may be applied to other types of programming environments. Forexample, VisualBasic, C++ and Smalltalk are other programmingenvironments in which the processes of the present invention may beapplied. In addition, the description of the classes along with thevariables, constructors, and methods are provided for purposes ofillustration only. Classes, variables, constructors, and methods mayvary depending on the particular implementation. Illustration of theseclasses, variables, constructors are for illustrative purposes and notintended to limit the architectural pattern of the present invention.The embodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

1. A method in a data processing system for displaying a component orcontainer, the method comprising the data processing system implementedsteps of: displaying the component within a display using a firstobject; responsive to a receipt within the first object of selected userinput, sending, by the first object, the user input to a third object;controlling a location of the component within the display using asecond object, wherein the second object controls the location of thecomponent in response to receiving an event from the third object;responsive to the third object receiving the selected user input, using,by the third object, the user input to determine whether a change in thelocation is required; and responsive to a determination by the thirdobject that the change in the location is required, selectivelydisplaying the component using the third object by generating the eventby the third object, the event indicating that the location is to bechanged, wherein the third object generates the event.
 2. The method ofclaim 1, wherein the first object is a view controller, the secondobject is a placement listener, and the third object is an applicationmediator.
 3. A method in a data processing system for displaying agraphical user interface, the method comprising: displaying a containerfor a graphical user interface using a view controller object;responsive to a receipt within the view controller of selected userinput, sending, by the view controller, the user input to an applicationmediator object; controlling a location of the container using aplacement object, wherein the placement object controls the location ofthe container in the graphical user interface in response to receivingan event from the application mediator object; responsive to theapplication mediator object receiving the selected user input, using, bythe application mediator object, the selected user input to determinewhether a change in the location is required; and responsive to adetermination by the application mediator object that the change in thelocation is required, generating the event using the applicationmediator object, the event indicating that the location is to bechanged, wherein the event is sent to the placement object.
 4. Themethod of claim 3, wherein the container is a panel.
 5. The method ofclaim 3, wherein the container is a button.
 6. A display mechanism foruse in a data processing system to display a container in a display inthe data processing system, the display mechanism comprising: a firstobject used to display a graphical user interface in the display and toreceive user input; response to a receipt of said user input by thefirst object, said first object for sending the user input to a thirdobject; a second object used to control a location of the graphical userinterface in the display in response to receiving an event from thethird object; the third object for using the user input to determinewhether a change in the location is required in response to the thirdobject receiving the selected user input and the third object forgenerating the event responsive to a determination by the third objectthat the change in the location is required, the event indicating thatthe location is to be changed.
 7. The display mechanism of claim 6,wherein the first object is a display object and the second object is apositioning object.
 8. The display mechanism of claim 7, wherein thedisplay object is an instance of a view controller.
 9. The displaymechanism of claim 7, wherein the positioning object is an instance of aplacement listener.
 10. The display mechanism of claim 6, wherein thedisplay mechanism is implemented in Java.
 11. The display mechanism ofclaim 6, wherein the second object is useable with a plurality of firstobjects.
 12. The display mechanism of claim 6, wherein the first objectis a view controller, the second object is a placement listener, and thethird object is an application mediator.
 13. A data processing systemfor displaying a component or container, the system comprising:displaying means for displaying the component within a display using afirst object; sending means for sending user input from the first objectto a third object responsive to a receipt within the first object of theuser input; controlling means for controlling a location of thecomponent within the display using a second object, wherein the secondobject controls the location of the component in response to receivingan event from the third object; determining means responsive to thethird object receiving the user input, for using the user input todetermine, by the third object, whether a change in the location isrequired; and displaying means responsive to a determination by thethird object that the change in the location is required, forselectively displaying the component using the third object bygenerating the event by the third object, the event indicating that thelocation is to be changed, wherein the third object generates the event.14. The system of claim 13, wherein the first object is a viewcontroller, the second object is a placement listener, and the thirdobject is an application mediator.
 15. A data processing system fordisplaying a graphical user interface, the system comprising: displayingmeans for displaying a container for a graphical user interface using aview controller object; sending means responsive to a receipt within theview controller object of selected user input, for sending, by the viewcontroller object, the user input to an application mediator object;controlling means for controlling a location of a container using aplacement object, wherein the placement object controls the location ofthe container in the graphical user interface in response to receivingan event from the application mediator object; determining meansresponsive to the application mediator object receiving the selecteduser input, for using the user input to determine, by the applicationmediator object, whether a change in the location is required; andgenerating means responsive to a determination by the applicationmediator object that the change in the location is required, forgenerating the event using the application mediator object, the eventindicating that the location is to be changed, wherein the event is sentto the placement object.
 16. The system of claim 15, wherein thecontainer is a panel.
 17. The system of claim 15 wherein the containeris a button.